public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [sched/rt] Optimization of function pull_rt_task()
@ 2012-04-15 19:45 Kirill Tkhai
  2012-04-16 16:06 ` Steven Rostedt
  0 siblings, 1 reply; 9+ messages in thread
From: Kirill Tkhai @ 2012-04-15 19:45 UTC (permalink / raw)
  To: linux-kernel; +Cc: Ingo Molnar, Peter Zijlstra, Steven Rostedt

The condition (src_rq->rt.rt_nr_running) is weak because it doesn't
consider the cases when src_rq has only processes bound to it (when
single cpu is allowed). It may be running kernel thread like
migration/x etc.

So it's better to use more stronger condition which is able to exclude
above conditions. The function has_pushable_tasks() complitely does
this. A task may be pullable for another cpu rq only if he is pushable
for his own queue.

Signed-off-by: Kirill Tkhai <tkhai@yandex.ru>
---
 kernel/sched/rt.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c
index c5565c3..61e3086 100644
--- a/kernel/sched/rt.c
+++ b/kernel/sched/rt.c
@@ -1729,7 +1729,7 @@ static int pull_rt_task(struct rq *this_rq)
 		/*
 		 * Are there still pullable RT tasks?
 		 */
-		if (src_rq->rt.rt_nr_running <= 1)
+		if (!has_pushable_tasks(src_rq))
 			goto skip;
 
 		p = pick_next_highest_task_rt(src_rq, this_cpu);



^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2012-12-18 10:43 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-15 19:45 [sched/rt] Optimization of function pull_rt_task() Kirill Tkhai
2012-04-16 16:06 ` Steven Rostedt
2012-04-18 18:32   ` Steven Rostedt
2012-04-18 21:16     ` Steven Rostedt
2012-04-19  8:54       ` Yong Zhang
2012-06-01 16:45         ` Kirill Tkhai
2012-06-04  5:27           ` Yong Zhang
2012-11-15 20:35             ` Steven Rostedt
2012-12-18 10:43               ` Kirill Tkhai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox