[PATCH 06/23] Subject: SCHED - wake up balance RT

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <mingo@...>
Cc: <rostedt@...>, <ghaskins@...>, <linux-rt-users@...>, <linux-kernel@...>
Date: Tuesday, December 4, 2007 - 4:44 pm

From: Steven Rostedt <srostedt@redhat.com>

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: Gregory Haskins <ghaskins@novell.com>
---

 kernel/sched.c    |    3 +++
 kernel/sched_rt.c |   10 ++++++++++
 2 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/kernel/sched.c b/kernel/sched.c
index a30147e..ebd114b 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -22,6 +22,8 @@
  *              by Peter Williams
  *  2007-05-06  Interactivity improvements to CFS by Mike Galbraith
  *  2007-07-01  Group scheduling enhancements by Srivatsa Vaddagiri
+ *  2007-10-22  RT overload balancing by Steven Rostedt
+ *                 (with thanks to Gregory Haskins)
  */
 
 #include <linux/mm.h>
@@ -1641,6 +1643,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 a2f1057..a0b05ff 100644
--- a/kernel/sched_rt.c
+++ b/kernel/sched_rt.c
@@ -556,6 +556,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
@@ -663,6 +672,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)

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 00/23] RT balance v7, Gregory Haskins, (Tue Dec 4, 4:44 pm)
Re: [PATCH 00/23] RT balance v7, Ingo Molnar, (Tue Dec 4, 5:27 pm)
[PATCH 0/3] RT balance v7a, Gregory Haskins, (Tue Dec 4, 10:55 pm)
[PATCH 1/3] Subject: SCHED - Add sched-domain roots, Gregory Haskins, (Tue Dec 4, 10:55 pm)
Re: [PATCH 00/23] RT balance v7, Gregory Haskins, (Tue Dec 4, 5:35 pm)
[PATCH 21/23] Subject: SCHED - Add sched-domain roots, Gregory Haskins, (Tue Dec 4, 4:46 pm)
[PATCH 16/23] Subject: SCHED - Avoid overload, Gregory Haskins, (Tue Dec 4, 4:45 pm)
[PATCH 19/23] Subject: SCHED - Optimize out cpu_clears, Gregory Haskins, (Tue Dec 4, 4:46 pm)
[PATCH 15/23] Subject: SCHED - Optimize rebalancing, Gregory Haskins, (Tue Dec 4, 4:45 pm)
[PATCH 03/23] Subject: SCHED - push RT tasks, Gregory Haskins, (Tue Dec 4, 4:44 pm)
[PATCH 06/23] Subject: SCHED - wake up balance RT, Gregory Haskins, (Tue Dec 4, 4:44 pm)
[PATCH 05/23] Subject: SCHED - pull RT tasks, Gregory Haskins, (Tue Dec 4, 4:44 pm)