lockdep: Fix lock_is_held on recursion
PATCH 1/1 lockdep: Fix lock_is_held on recursion
Subject: lockdep: Fix lock_is_held on recursion
From: Peter Zijlstra <[email protected]>
Date: Mon Jun 06 12:32:43 CEST 2011
The main lock_is_held() user is lockdep_assert_held(), avoid false assertions in lockdep_off() sections by unconditionally reporting the lock is taken.
[ the reason this is important is a lockdep_assert_held() in ttwu()
which triggers a warning under lockdep_off() as in printk() which can trigger another wakeup and lock up due to spinlock recursion ]
---
kernel/lockdep.c +1 -1
@@ -3426,7 +3426,7 @@ int lock_is_held(struct lockdep_map *locint ret =0 ;if (unlikely (current->lockdep_recursion)) -return ret; +return 1 ;/* avoid false negative lockdep_assert_held */ raw_local_irq_save (flags);check_flags (flags);
[tip:sched/urgent] lockdep: Fix lock_is_held() on recursion
Commit-ID: f2513cde93f0957d5dc6c09bc24b0cccd27d8e1d Gitweb: http://git.kernel.org/tip/f2513cde93f0957d5dc6c09bc24b0cccd27d8e1d Author: Peter Zijlstra <[email protected]> AuthorDate: Mon, 6 Jun 2011 12:32:43 +0200 Committer: Ingo Molnar <[email protected]> CommitDate: Tue, 7 Jun 2011 12:25:50 +0200
lockdep: Fix lock_is_held() on recursion
The main lock_is_held() user is lockdep_assert_held(), avoid false assertions in lockdep_off() sections by unconditionally reporting the lock is taken.
[ the reason this is important is a lockdep_assert_held() in ttwu()
which triggers a warning under lockdep_off() as in printk() which can trigger another wakeup and lock up due to spinlock recursion, as reported and heroically debugged by Arne Jansen ]
--- kernel/lockdep.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
kernel/lockdep.c +1 -1
@@ -3426,7 +3426,7 @@ int lock_is_held(struct lockdep_map *lock)int ret =0 ;if (unlikely (current->lockdep_recursion)) -return ret; +return 1 ;/* avoid false negative lockdep_assert_held() */ raw_local_irq_save (flags);check_flags (flags);
Re: [tip:sched/urgent] lockdep: Fix lock_is_held() on recursion
Quoted 18 lines · tip-bot for Peter Zijlstra
Commit-ID: f2513cde93f0957d5dc6c09bc24b0cccd27d8e1d Gitweb: http://git.kernel.org/tip/f2513cde93f0957d5dc6c09bc24b0cccd27d8e1d Author: Peter Zijlstra <[email protected]> AuthorDate: Mon, 6 Jun 2011 12:32:43 +0200 Committer: Ingo Molnar <[email protected]> CommitDate: Tue, 7 Jun 2011 12:25:50 +0200lockdep: Fix
lock_is_held()on recursionThe main
lock_is_held()user islockdep_assert_held(), avoid false assertions inlockdep_off()sections by unconditionally reporting the lock is taken.[ the reason this is important is a
lockdep_assert_held()inttwu()
which triggers a warning underlockdep_off()as inprintk()which can trigger another wakeup and lock up due to spinlock recursion, as reported and heroically debugged by Arne Jansen ]
Quoted 4 lines
Reported-and-tested-by Arne Jansen <[email protected]>Signed-off-by Peter Zijlstra <[email protected]>Cc Linus Torvalds <[email protected]>Cc <[email protected]>
Not _that_ critical for stable since the offending lockdep_assert_held() doesn't exist in .39, still definitely won't hurt.
Re: [tip:sched/urgent] lockdep: Fix lock_is_held() on recursion
Quoted 19 lines · Peter Zijlstra
Quoted 18 lines · tip-bot for Peter Zijlstra
Commit-ID: f2513cde93f0957d5dc6c09bc24b0cccd27d8e1d Gitweb: http://git.kernel.org/tip/f2513cde93f0957d5dc6c09bc24b0cccd27d8e1d Author: Peter Zijlstra <[email protected]> AuthorDate: Mon, 6 Jun 2011 12:32:43 +0200 Committer: Ingo Molnar <[email protected]> CommitDate: Tue, 7 Jun 2011 12:25:50 +0200lockdep: Fix
lock_is_held()on recursionThe main
lock_is_held()user islockdep_assert_held(), avoid false assertions inlockdep_off()sections by unconditionally reporting the lock is taken.[ the reason this is important is a
lockdep_assert_held()inttwu()
which triggers a warning underlockdep_off()as inprintk()which can trigger another wakeup and lock up due to spinlock recursion, as reported and heroically debugged by Arne Jansen ]
Quoted 7 lines
Quoted 4 lines
Reported-and-tested-by Arne Jansen <[email protected]>Signed-off-by Peter Zijlstra <[email protected]>Cc Linus Torvalds <[email protected]>Cc <[email protected]>Not _that_ critical for stable since the offending
lockdep_assert_held()doesn't exist in .39, still definitely won't hurt.
Correct, the bug was hard enough to find, i didnt want someone else to trigger a similar one. There's numerous lockdep_assert_held() instances all around the tree.
Thanks,
Ingo