public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sched:skip loop non-idle cpus after find an idle cpu while find_idlest_cpu
@ 2014-10-27  3:13 Yao Dongdong
  2014-10-27  8:04 ` Srikar Dronamraju
  0 siblings, 1 reply; 4+ messages in thread
From: Yao Dongdong @ 2014-10-27  3:13 UTC (permalink / raw)
  To: Ingo Molnar, Peter Zijlstra; +Cc: LKML, yaodongdong

Idle cpu is idler than non-idle cpu, so we needn't loop non-idle cpus after find an idle cpu.

Signed-off-by:yaodongdong@huawei.com

---
 kernel/sched/fair.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 0b069bf..2445a23 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -4446,7 +4446,7 @@ find_idlest_cpu(struct sched_group *group, struct task_struct *p, int this_cpu)
                                latest_idle_timestamp = rq->idle_stamp;
                                shallowest_idle_cpu = i;
                        }
-               } else {
+               } else if (shallowest_idle_cpu == -1) {
                        load = weighted_cpuload(i);
                        if (load < min_load || (load == min_load && i == this_cpu)) {
                                min_load = load;
--
1.8.0.1


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

end of thread, other threads:[~2014-10-27  9:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-27  3:13 [PATCH] sched:skip loop non-idle cpus after find an idle cpu while find_idlest_cpu Yao Dongdong
2014-10-27  8:04 ` Srikar Dronamraju
2014-10-27  8:58   ` Yao Dongdong
2014-10-27  9:23     ` Srikar Dronamraju

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