Re: [BUG] sysfs: don't use allocated key for lockdep

From: Jiri Kosina
Date: Tue Apr 20 2010 - 12:09:36 EST


On Tue, 20 Apr 2010, Greg KH wrote:

> > lockdep_init_map() {
> > ......
> > /*
> > * Sanity check, the lock-class key must be persistent:
> > */
> > if (!static_obj(key)) {
> > printk("BUG: key %p not in .data!\n", key);
> > DEBUG_LOCKS_WARN_ON(1);
> > return;
> > }
> > lock->key = key;
> > ......
> > }
> >
> > Could you please fix it.
>
> All in-kernel attributes should now be fixed, so what exactly is the
> remaining issue?

Are they?

How about my fix to drivers/hwmon/asus_atk0110.c for example, I sent last
week? http://lkml.org/lkml/2010/4/14/458

> > ----------------
> > One other comment (not relate to this bug, but relate to the commit):
> > It is not a very good idea that use one lockdep class per sysfs attribute.
> >
> > First: we don't have too much lockdep class resource.
> > Second: lockdep validator is O(N*N) algorithm.
> > (N is the number of used lockdep class)
> >
> > So it is recommended that use only one class for a group of locks.
> >
> > For some nesting requirement, you can use
> > lock_acquire(...,subclass,...nest_lock,...)
> >
> > Or change the design.
> > --------------------
> >
> > BUG: key ffff880042c68220 not in .data!
> > ------------[ cut here ]------------
> > WARNING: at kernel/lockdep.c:2706 lockdep_init_map+0xe6/0x4fb()
> > Hardware name: Lenovo WQ T168/T468 G6
> > Modules linked in: mptsas(+) mptscsih mptbase scsi_transport_sas ext4 jbd2 crc16 uhci_hcd ohci_hcd ehci_hcd
> > Pid: 1329, comm: modprobe Not tainted 2.6.34-rc3-22949-gbc8a97a-dirty #1
>
> Please try 2.6.34-rc5 and let us know if this still shows up.

This particular one should indeed by fixed by upstream commit
ebd09ec93c90c8 though.

Thanks,

--
Jiri Kosina
SUSE Labs, Novell Inc.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/