linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH]sched/rt.c: Don't pull tasks to throttled rt_rq's
@ 2012-11-22 20:36 Kirill Tkhai
  0 siblings, 0 replies; only message in thread
From: Kirill Tkhai @ 2012-11-22 20:36 UTC (permalink / raw)
  To: linux-kernel; +Cc: Steven Rostedt, Ingo Molnar, Peter Zijlstra, Tkhai Kirill

The most probably, next after pull_rt_task action will be picking a task
from the rq. So it's useless to pull tasks whose (corresponding to rq)
rt_rq is throttled.

Signed-off-by: Kirill V Tkhai <tkhai@yandex.ru>
CC: Steven Rostedt <rostedt@goodmis.org>
CC: Ingo Molnar <mingo@kernel.org>
CC: Peter Zijlstra <peterz@infradead.org>
---
 kernel/sched/rt.c |   13 +++++++++++++
 1 file changed, 13 insertions(+)
diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c
index 418feb0..10863e4 100644
--- a/kernel/sched/rt.c
+++ b/kernel/sched/rt.c
@@ -1708,6 +1708,16 @@ static void push_rt_tasks(struct rq *rq)
 		;
 }
 
+static inline int remote_rt_rq_throttled(struct task_struct *p, int remote_cpu)
+{
+	struct rt_rq *rt_rq = rt_rq_of_se(&p->rt);
+	struct rt_bandwidth *rt_b = sched_rt_bandwidth(rt_rq);
+
+	rt_rq = sched_rt_period_rt_rq(rt_b, remote_cpu);
+
+	return rt_rq_throttled(rt_rq);
+}
+
 static int pull_rt_task(struct rq *this_rq)
 {
 	int this_cpu = this_rq->cpu, ret = 0, cpu;
@@ -1768,6 +1778,9 @@ static int pull_rt_task(struct rq *this_rq)
 			if (p->prio < src_rq->curr->prio)
 				goto skip;
 
+			if (remote_rt_rq_throttled(p, this_cpu))
+				goto skip;
+
 			ret = 1;
 
 			deactivate_task(src_rq, p, 0);

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2012-11-22 20:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-22 20:36 [PATCH]sched/rt.c: Don't pull tasks to throttled rt_rq's Kirill Tkhai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).