[lkml]   [2014]   [Feb]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] printk: fix one circular lockdep warning about console_lock
On 02/12/2014 05:19 AM, Andrew Morton wrote:

>> There are three locks involved in two sequence:
>> a) pm suspend:
>> console_lock (@suspend_console())
>> cpu_add_remove_lock (@disable_nonboot_cpus())
>> cpu_hotplug.lock (@_cpu_down())
> But but but. suspend_console() releases console_sem again.

Console_lock does not refer to console_sem but console_lock_dep_map. Its name is console_lock. Suspend_console() does not release console_lock_dep_map.

> So the
> sequence is actually
> down(&console_sem) (@suspend_console())

acquire(&console_lock_dep_map) (&suspend_console())

> up(&console_sem) (@suspend_console())
> cpu_add_remove_lock (@disable_nonboot_cpus())
> cpu_hotplug.lock (@_cpu_down())
> So console_sem *doesn't* nest outside cpu_add_remove_lock and
> cpu_hotplug.lock.

Add console_lock in the sequence.

>> b) Plug-out CPUx:
>> cpu_add_remove_lock (@(cpu_down())
>> cpu_hotplug.lock (@_cpu_down())
>> console_lock (@console_cpu_notify()) => Lockdeps prints warning log.
>> There should be not real deadlock, as flag of console_suspended can
>> protect this.
> console_lock() does down(&console_sem) *before* testing
> console_suspended, so I don't understand this sentence - a more
> detailed description would help.

After suspend_console(), console_sem is unlocked, but console_lock_dep_map has been acquired.

Best Regards,

 \ /
  Last update: 2014-02-14 09:41    [W:0.106 / U:6.104 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site