diff options
author | Peter Zijlstra <a.p.zijlstra@chello.nl> | 2010-11-09 14:36:52 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2010-11-10 23:13:58 +0100 |
commit | 2d46709082c062cae7cce1a15f8cd4cd81b92d88 (patch) | |
tree | 8222a0f18aca8a91c7929264d83bf6010a905993 /kernel | |
parent | aae6d3ddd8b90f5b2c8d79a2b914d1706d124193 (diff) | |
download | kernel_samsung_crespo-2d46709082c062cae7cce1a15f8cd4cd81b92d88.zip kernel_samsung_crespo-2d46709082c062cae7cce1a15f8cd4cd81b92d88.tar.gz kernel_samsung_crespo-2d46709082c062cae7cce1a15f8cd4cd81b92d88.tar.bz2 |
sched: Fix runnable condition for stoptask
Heiko reported that the TASK_RUNNING check is not sufficient for
CONFIG_PREEMPT=y since we can get preempted with !TASK_RUNNING.
He suggested adding a ->se.on_rq test to the existing TASK_RUNNING
one, however TASK_RUNNING will always have ->se.on_rq, so we might as
well reduce that to a single test.
[ stop tasks should never get preempted, but its good to handle
this case correctly should this ever happen ]
Reported-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/sched_stoptask.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/sched_stoptask.c b/kernel/sched_stoptask.c index 45bddc0..755483b 100644 --- a/kernel/sched_stoptask.c +++ b/kernel/sched_stoptask.c @@ -26,7 +26,7 @@ static struct task_struct *pick_next_task_stop(struct rq *rq) { struct task_struct *stop = rq->stop; - if (stop && stop->state == TASK_RUNNING) + if (stop && stop->se.on_rq) return stop; return NULL; |