diff options
author | Gregory Haskins <ghaskins@novell.com> | 2008-04-23 07:13:29 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-05-05 17:56:18 -0400 |
commit | 8ae121ac8666b0421aa20fd80d4597ec66fa54bc (patch) | |
tree | 1db411965b1b12029d501ea10ab90fbc8aa4ec62 /kernel/sched_rt.c | |
parent | 983ed7a66bcec9dc307d89dc7af47cdf209e56af (diff) |
sched: fix RT task-wakeup logic
Dmitry Adamushko pointed out a logic error in task_wake_up_rt() where we
will always evaluate to "true". You can find the thread here:
http://lkml.org/lkml/2008/4/22/296
In reality, we only want to try to push tasks away when a wake up request is
not going to preempt the current task. So lets fix it.
Note: We introduce test_tsk_need_resched() instead of open-coding the flag
check so that the merge-conflict with -rt should help remind us that we
may need to support NEEDS_RESCHED_DELAYED in the future, too.
Signed-off-by: Gregory Haskins <ghaskins@novell.com>
CC: Dmitry Adamushko <dmitry.adamushko@gmail.com>
CC: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/sched_rt.c')
-rw-r--r-- | kernel/sched_rt.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/kernel/sched_rt.c b/kernel/sched_rt.c index dcd649588593..060e87b0cb1c 100644 --- a/kernel/sched_rt.c +++ b/kernel/sched_rt.c | |||
@@ -1098,11 +1098,14 @@ static void post_schedule_rt(struct rq *rq) | |||
1098 | } | 1098 | } |
1099 | } | 1099 | } |
1100 | 1100 | ||
1101 | 1101 | /* | |
1102 | * If we are not running and we are not going to reschedule soon, we should | ||
1103 | * try to push tasks away now | ||
1104 | */ | ||
1102 | static void task_wake_up_rt(struct rq *rq, struct task_struct *p) | 1105 | static void task_wake_up_rt(struct rq *rq, struct task_struct *p) |
1103 | { | 1106 | { |
1104 | if (!task_running(rq, p) && | 1107 | if (!task_running(rq, p) && |
1105 | (p->prio >= rq->rt.highest_prio) && | 1108 | !test_tsk_need_resched(rq->curr) && |
1106 | rq->rt.overloaded) | 1109 | rq->rt.overloaded) |
1107 | push_rt_tasks(rq); | 1110 | push_rt_tasks(rq); |
1108 | } | 1111 | } |