]> git.baikalelectronics.ru Git - kernel.git/commit
[BKL] add 'might_sleep()' to the outermost lock taker
authorLinus Torvalds <torvalds@linux-foundation.org>
Sat, 12 Dec 2009 22:46:33 +0000 (14:46 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 12 Dec 2009 22:46:33 +0000 (14:46 -0800)
commit3b3c66ad6148f6ab3bb8d9eaa21dcef8d5c82493
treea4e249cc4b5880b841487c889c32be8b5414fd11
parentd8a0d107142653a25cc0cd0ec45692db0e991f50
[BKL] add 'might_sleep()' to the outermost lock taker

As shown by the previous patch (d8a0d1071: "tty: Fix BKL taken under a
spinlock bug introduced in the BKL split") the BKL removal is prone to
some subtle issues, where removing the BKL in one place may in fact make
a previously nested BKL call the new outer call, and then prone to nasty
deadlocks with other spinlocks.

In general, we should never take the BKL while we're holding a spinlock,
so let's just add a "might_sleep()" to it (even though the BKL doesn't
technically sleep - at least not yet), and we'll get nice warnings the
next time this kind of problem happens during BKL removal.

Acked-and-Tested-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
lib/kernel_lock.c