Staging
v0.5.1
https://github.com/torvalds/linux
Revision ba0084048ab785c2cb1d6cc2cccabe642a5b799a authored by Mark Fasheh on 22 December 2006, 09:06:15 UTC, committed by Linus Torvalds on 22 December 2006, 16:55:46 UTC
Commit 2d7d253548cffdce80f4e03664686e9ccb1b0ed7 ("fix cond_resched() fix")
introduced an 'expected_preempt_count' parameter to __resched_legal() to
fix a bug where it was returning a false negative when called from
cond_resched_lock() and preemption was enabled.

Unfortunately this broke things for when preemption is disabled.
preempt_count() will always return zero, thus failing the check against any
value of expected_preempt_count not equal to zero.  cond_resched_lock() for
example, passes an expected_preempt_count value of 1.

So fix the fix for the cond_resched() fix by skipping the check of
preempt_count() against expected_preempt_count when preemption is disabled.

Credit should go to Sunil Mushran for spotting the bug during testing.

Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
1 parent 2aea4fb
History
Tip revision: ba0084048ab785c2cb1d6cc2cccabe642a5b799a authored by Mark Fasheh on 22 December 2006, 09:06:15 UTC
[PATCH] Conditionally check expected_preempt_count in __resched_legal()
Tip revision: ba00840
File Mode Size
Documentation
arch
block
crypto
drivers
fs
include
init
ipc
kernel
lib
mm
net
scripts
security
sound
usr
.gitignore -rw-r--r-- 547 bytes
COPYING -rw-r--r-- 18.3 KB
CREDITS -rw-r--r-- 88.5 KB
Kbuild -rw-r--r-- 1.2 KB
MAINTAINERS -rw-r--r-- 75.6 KB
Makefile -rw-r--r-- 49.1 KB
README -rw-r--r-- 16.5 KB
REPORTING-BUGS -rw-r--r-- 3.0 KB

README

back to top