aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2005-07-07 20:57:04 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-07-07 21:23:47 -0400
commit5bbcfd9000887c0da7d57cc7b3ac869fc0dd5aa9 (patch)
tree7047a60dc99e5484560b40027c81f92a4e291b29
parenta4014d8f61a6a136d22422cf8aa978e6495dbad9 (diff)
[PATCH] cond_resched(): fix bogus might_sleep() warning
The BKS might be reacquired before we have dropped PREEMPT_ACTIVE, which could trigger a second could trigger a second cond_resched() call. Bug found by Hirofumi Ogawa. Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--kernel/sched.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index 5f2182d42241..4107db0dc091 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -3877,6 +3877,13 @@ asmlinkage long sys_sched_yield(void)
3877 3877
3878static inline void __cond_resched(void) 3878static inline void __cond_resched(void)
3879{ 3879{
3880 /*
3881 * The BKS might be reacquired before we have dropped
3882 * PREEMPT_ACTIVE, which could trigger a second
3883 * cond_resched() call.
3884 */
3885 if (unlikely(preempt_count()))
3886 return;
3880 do { 3887 do {
3881 add_preempt_count(PREEMPT_ACTIVE); 3888 add_preempt_count(PREEMPT_ACTIVE);
3882 schedule(); 3889 schedule();