[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20110805152755.GA4148@swordfish.minsk.epam.com>
Date: Fri, 5 Aug 2011 18:27:55 +0300
From: Sergey Senozhatsky <sergey.senozhatsky@...il.com>
To: Peter Zijlstra <a.p.zijlstra@...llo.nl>
Cc: Ingo Molnar <mingo@...e.hu>, Thomas Gleixner <tglx@...utronix.de>,
Andrew Morton <akpm@...ux-foundation.org>,
linux-kernel@...r.kernel.org,
KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>,
linux-mm@...ck.org
Subject: Re: select_task_rq_fair: WARNING: at kernel/lockdep.c match_held_lock
On (08/05/11 14:36), Peter Zijlstra wrote:
> The below is what I've come up with.
>
Hello,
I think that should work. Will test, anyway.
Thanks,
Sergey
> ---
> Subject: lockdep: Fix wrong assumption in match_held_lock
> From: Peter Zijlstra <a.p.zijlstra@...llo.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@...il.com>
> Signed-off-by: Peter Zijlstra <a.p.zijlstra@...llo.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))
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists