Re: Re: lockdep report in hibernate code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 26 Oct 2007, Johannes Berg wrote:

> > > We have two paths here:
> > > 
> > >  (a) sysfs write -> lock buffer -> call power management code 
> > >      -> lock pm_mutex
> > >  (b) boot code -> power management boot -> lock pm_mutex
> > >      -> use name_to_dev_t() -> call sysfs -> lock buffer
> > > 
> > > As you can see, lockdep rightfully complains about a possible deadlock
> > > scenario although of course (b) only happens once at boot at a time
> > > where (a) cannot happen. And now we're wondering how to fix it.
> > 
> > Why not use mutex_lock_nested() for the boot-time pm_mutex lock call?
> 
> Is that going to help though? I thought lock_nested() is only for nested
> within a class.

The "nested" part of the name is a little misleading.  The function
helps the lockdep core distinguish between locks belonging to the same
class.  Normally this is be done so that you can nest the locks in the
proper order, but that shouldn't stop you from using it here.

Alan Stern

_______________________________________________
linux-pm mailing list
linux-pm@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linux-foundation.org/mailman/listinfo/linux-pm

[Index of Archives]     [Linux ACPI]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [CPU Freq]     [Kernel Newbies]     [Fedora Kernel]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux