From: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
To: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Ingo Molnar <mingo@elte.hu>, Thomas Gleixner <tglx@linutronix.de>,
Andrew Morton <akpm@linux-foundation.org>,
linux-kernel@vger.kernel.org,
KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
linux-mm@kvack.org
Subject: Re: select_task_rq_fair: WARNING: at kernel/lockdep.c match_held_lock
Date: Sat, 6 Aug 2011 22:39:14 +0300 [thread overview]
Message-ID: <20110806193914.GA4008@swordfish> (raw)
In-Reply-To: <1312547780.28695.1.camel@twins>
[-- Attachment #1: Type: text/plain, Size: 1987 bytes --]
On (08/05/11 14:36), Peter Zijlstra wrote:
> The below is what I've come up with.
>
Hello,
Without any problems so far (using qemu quite often these days).
Feel free to add my
Tested-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Sergey
> ---
> Subject: lockdep: Fix wrong assumption in match_held_lock
> From: Peter Zijlstra <a.p.zijlstra@chello.nl>
> Date: Fri Aug 05 14:26:17 CEST 2011
>
> match_held_lock() was assuming it was being called on a lock class
> that had already seen usage.
>
> This condition was true for bug-free code using lockdep_assert_held(),
> since you're in fact holding the lock when calling it. However the
> assumption fails the moment you assume the assertion can fail, which
> is the whole point of having the assertion in the first place.
>
> Anyway, now that there's more lockdep_is_held() users, notably
> __rcu_dereference_check(), its much easier to trigger this since we
> test for a number of locks and we only need to hold any one of them to
> be good.
>
> Reported-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
> ---
> kernel/lockdep.c | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
>
> Index: linux-2.6/kernel/lockdep.c
> ===================================================================
> --- linux-2.6.orig/kernel/lockdep.c
> +++ linux-2.6/kernel/lockdep.c
> @@ -3111,7 +3111,13 @@ static int match_held_lock(struct held_l
> if (!class)
> class = look_up_lock_class(lock, 0);
>
> - if (DEBUG_LOCKS_WARN_ON(!class))
> + /*
> + * If look_up_lock_class() failed to find a class, we're trying
> + * to test if we hold a lock that has never yet been acquired.
> + * Clearly if the lock hasn't been acquired _ever_, we're not
> + * holding it either, so report failure.
> + */
> + if (!class)
> return 0;
>
> if (DEBUG_LOCKS_WARN_ON(!hlock->nest_lock))
>
[-- Attachment #2: Type: application/pgp-signature, Size: 316 bytes --]
prev parent reply other threads:[~2011-08-06 19:40 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-04 14:13 select_task_rq_fair: WARNING: at kernel/lockdep.c match_held_lock Sergey Senozhatsky
2011-08-04 15:05 ` Peter Zijlstra
2011-08-04 15:13 ` Peter Zijlstra
2011-08-04 15:37 ` Sergey Senozhatsky
2011-08-04 15:47 ` Peter Zijlstra
2011-08-04 15:53 ` Sergey Senozhatsky
2011-08-04 15:57 ` Peter Zijlstra
2011-08-04 16:04 ` Sergey Senozhatsky
2011-08-05 12:36 ` Peter Zijlstra
2011-08-05 15:27 ` Sergey Senozhatsky
2011-08-06 19:39 ` Sergey Senozhatsky [this message]
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=20110806193914.GA4008@swordfish \
--to=sergey.senozhatsky@gmail.com \
--cc=a.p.zijlstra@chello.nl \
--cc=akpm@linux-foundation.org \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mingo@elte.hu \
--cc=tglx@linutronix.de \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).