OSDN Git Service

locking/lockdep: Use for_each_process_thread() for debug_show_all_locks()
authorTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Fri, 6 Apr 2018 10:41:18 +0000 (19:41 +0900)
committerIngo Molnar <mingo@kernel.org>
Mon, 14 May 2018 07:15:02 +0000 (09:15 +0200)
commit0f736a52e4be86476eec1d5adbcbd9c2809ac4b4
treed1a995699c621493e9e7e45c0bf64d404b3c26aa
parent12e2c41148a9e68bc3b261954961db9d28decf47
locking/lockdep: Use for_each_process_thread() for debug_show_all_locks()

debug_show_all_locks() tries to grab the tasklist_lock for two seconds, but
calling while_each_thread() without tasklist_lock held is not safe.

See the following commit for more information:

  4449a51a7c281602 ("vm_is_stack: use for_each_thread() rather then buggy while_each_thread()")

Change debug_show_all_locks() from "do_each_thread()/while_each_thread()
with possibility of missing tasklist_lock" to "for_each_process_thread()
with RCU", and add a call to touch_all_softlockup_watchdogs() like
show_state_filter() does.

Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1523011279-8206-1-git-send-email-penguin-kernel@I-love.SAKURA.ne.jp
Signed-off-by: Ingo Molnar <mingo@kernel.org>
kernel/locking/lockdep.c