diff options
author | Steven Rostedt <srostedt@redhat.com> | 2008-01-25 21:08:07 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-01-25 21:08:07 +0100 |
commit | 4642dafdf93dc7d66ee33437b93a5e6b8cea20d2 (patch) | |
tree | 4e3fd9c95be1ed14e9f40b2dcf232c40e5ab8fef | |
parent | f65eda4f789168ba5ff3fa75546c29efeed19f58 (diff) | |
download | linux-4642dafdf93dc7d66ee33437b93a5e6b8cea20d2.tar.bz2 |
sched: push RT tasks from overloaded CPUs
This patch adds pushing of overloaded RT tasks from a runqueue that is
having tasks (most likely RT tasks) added to the run queue.
TODO: We don't cover the case of waking of new RT tasks (yet).
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r-- | kernel/sched.c | 1 | ||||
-rw-r--r-- | kernel/sched_rt.c | 10 |
2 files changed, 11 insertions, 0 deletions
diff --git a/kernel/sched.c b/kernel/sched.c index c91797107913..357d3a084de8 100644 --- a/kernel/sched.c +++ b/kernel/sched.c @@ -1710,6 +1710,7 @@ out_activate: out_running: p->state = TASK_RUNNING; + wakeup_balance_rt(rq, p); out: task_rq_unlock(rq, &flags); diff --git a/kernel/sched_rt.c b/kernel/sched_rt.c index bacb32039e95..d38a8a559aa5 100644 --- a/kernel/sched_rt.c +++ b/kernel/sched_rt.c @@ -558,6 +558,15 @@ static void schedule_tail_balance_rt(struct rq *rq) } } + +static void wakeup_balance_rt(struct rq *rq, struct task_struct *p) +{ + if (unlikely(rt_task(p)) && + !task_running(rq, p) && + (p->prio >= rq->curr->prio)) + push_rt_tasks(rq); +} + /* * Load-balancing iterator. Note: while the runqueue stays locked * during the whole iteration, the current task might be @@ -665,6 +674,7 @@ move_one_task_rt(struct rq *this_rq, int this_cpu, struct rq *busiest, #else /* CONFIG_SMP */ # define schedule_tail_balance_rt(rq) do { } while (0) # define schedule_balance_rt(rq, prev) do { } while (0) +# define wakeup_balance_rt(rq, p) do { } while (0) #endif /* CONFIG_SMP */ static void task_tick_rt(struct rq *rq, struct task_struct *p) |