From: Jane Li <jiel@marvell.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: "joe@perches.com" <joe@perches.com>,
"tj@kernel.org" <tj@kernel.org>,
"fweisbec@gmail.com" <fweisbec@gmail.com>,
"davem@davemloft.net" <davem@davemloft.net>,
"keescook@chromium.org" <keescook@chromium.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Daniel Vetter <daniel.vetter@ffwll.ch>, Jan Kara <jack@suse.cz>
Subject: Re: [PATCH] printk: fix one circular lockdep warning about console_lock
Date: Fri, 14 Feb 2014 15:42:43 +0800 [thread overview]
Message-ID: <52FDC8F3.50100@marvell.com> (raw)
In-Reply-To: <20140211131927.f180ac29dede51b2733b92a6@linux-foundation.org>
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,
Jane
next prev parent reply other threads:[~2014-02-14 7:43 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-11 6:50 [PATCH] printk: fix one circular lockdep warning about console_lock jiel
2014-02-11 18:29 ` Kees Cook
2014-02-11 21:19 ` Andrew Morton
2014-02-11 21:35 ` Daniel Vetter
2014-02-13 10:48 ` Jan Kara
2014-02-14 7:42 ` Jane Li [this message]
2014-03-19 3:08 ` Jane Li
2014-03-19 10:00 ` Jan Kara
[not found] <23E65EE4544D484CBE73B588E192C6D620B93AC9EB@sc-vexch3.marvell.com>
[not found] ` <532A838D.8040209@marvell.com>
2014-03-20 6:15 ` Jane Li
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=52FDC8F3.50100@marvell.com \
--to=jiel@marvell.com \
--cc=akpm@linux-foundation.org \
--cc=daniel.vetter@ffwll.ch \
--cc=davem@davemloft.net \
--cc=fweisbec@gmail.com \
--cc=jack@suse.cz \
--cc=joe@perches.com \
--cc=keescook@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tj@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.