[<prev] [next>] [day] [month] [year] [list]
Message-Id: <973291353616584@web24h.yandex.ru>
Date: Fri, 23 Nov 2012 00:36:24 +0400
From: Kirill Tkhai <tkhai@...dex.ru>
To: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Cc: Steven Rostedt <rostedt@...dmis.org>,
Ingo Molnar <mingo@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
Tkhai Kirill <tkhai@...dex.ru>
Subject: [PATCH]sched/rt.c: Don't pull tasks to throttled rt_rq's
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@...dex.ru>
CC: Steven Rostedt <rostedt@...dmis.org>
CC: Ingo Molnar <mingo@...nel.org>
CC: Peter Zijlstra <peterz@...radead.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);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists