[PATCH] Fix spinlock debugging delays to not time out too early
authorIngo Molnar <mingo@elte.hu>
Tue, 7 Feb 2006 20:58:54 +0000 (12:58 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Wed, 8 Feb 2006 00:12:33 +0000 (16:12 -0800)
commite0a602963485a2f109ae1521c0c55507304c63ed
tree38900590f1d4f129cfd8748949ff62f7d3296aee
parent8519fb30e438f8088b71a94a7d5a660a814d3872
[PATCH] Fix spinlock debugging delays to not time out too early

The spinlock-debug wait-loop was using loops_per_jiffy to detect too long
spinlock waits - but on fast CPUs this led to a way too fast timeout and false
messages.

The fix is to include a __delay(1) call in the loop, to correctly approximate
the intended delay timeout of 1 second.  The code assumes that every
architecture implements __delay(1) to last around 1/(loops_per_jiffy*HZ)
seconds.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Cc: Andi Kleen <ak@muc.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
lib/spinlock_debug.c