]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
locking/lockdep: Move sanity check to inside lockdep_print_held_locks()
authorTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Fri, 6 Apr 2018 10:41:19 +0000 (19:41 +0900)
committerIngo Molnar <mingo@kernel.org>
Mon, 14 May 2018 07:15:02 +0000 (09:15 +0200)
commit8cc05c71ba5f793690bb72aeb404dce65b5d4b52
tree1a120bcc0d7129e9737e6979ab1aa9dd3546ee32
parent0f736a52e4be86476eec1d5adbcbd9c2809ac4b4
locking/lockdep: Move sanity check to inside lockdep_print_held_locks()

Calling lockdep_print_held_locks() on a running thread is considered unsafe.

Since all callers should follow that rule and the sanity check is not heavy,
this patch moves the sanity check to inside lockdep_print_held_locks().

As a side effect of this patch, the number of locks held by running threads
will be printed as well. This change will be preferable when we want to
know which threads might be relevant to a problem but are unable to print
any clues because that thread is running.

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