All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sched: keep quiescent cpu out of idle balance loop
@ 2014-02-19  5:20 Lei Wen
  2014-02-19  9:04 ` Peter Zijlstra
  0 siblings, 1 reply; 15+ messages in thread
From: Lei Wen @ 2014-02-19  5:20 UTC (permalink / raw)
  To: peterz, mingo, preeti.lkml, daniel.lezcano, viresh.kumar, xjian,
	leiwen, linux-kernel

Since cpu which is put into quiescent mode, would remove itself
from kernel's sched_domain. So we could use search sched_domain
method to check whether this cpu don't want to be disturbed as
idle load balance would send IPI to it.

Signed-off-by: Lei Wen <leiwen@marvell.com>
---
 kernel/sched/fair.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 235cfa7..14230ae 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -6783,6 +6783,8 @@ out_unlock:
  * - When one of the busy CPUs notice that there may be an idle rebalancing
  *   needed, they will kick the idle load balancer, which then does idle
  *   load balancing for all the idle CPUs.
+ * - exclude those cpus not inside current call_cpu's sched_domain, so that
+ *   those isolated cpu could be kept in their quisecnt mode.
  */
 static struct {
 	cpumask_var_t idle_cpus_mask;
@@ -6792,10 +6794,16 @@ static struct {
 
 static inline int find_new_ilb(void)
 {
-	int ilb = cpumask_first(nohz.idle_cpus_mask);
+	int ilb;
+	int cpu = smp_processor_id();
+	struct sched_domain *tmp;
 
-	if (ilb < nr_cpu_ids && idle_cpu(ilb))
-		return ilb;
+	for_each_domain(cpu, tmp) {
+		ilb = cpumask_first_and(nohz.idle_cpus_mask,
+				sched_domain_span(tmp));
+		if (ilb < nr_cpu_ids && idle_cpu(ilb))
+			return ilb;
+	}
 
 	return nr_cpu_ids;
 }
-- 
1.8.3.2


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

end of thread, other threads:[~2014-02-21  9:42 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-19  5:20 [PATCH] sched: keep quiescent cpu out of idle balance loop Lei Wen
2014-02-19  9:04 ` Peter Zijlstra
2014-02-20  2:42   ` Lei Wen
2014-02-20  8:50     ` Peter Zijlstra
2014-02-20  9:15       ` Lei Wen
2014-02-20  9:17       ` Lei Wen
2014-02-20 12:04         ` Peter Zijlstra
2014-02-20 12:23         ` Peter Zijlstra
2014-02-21  2:23           ` [PATCH v2] " Lei Wen
2014-02-21  5:51             ` Mike Galbraith
2014-02-21  7:28               ` Lei Wen
2014-02-21  8:34                 ` Mike Galbraith
2014-02-21  9:15                   ` [PATCH v3] " Lei Wen
2014-02-21  9:41                     ` Mike Galbraith
2014-02-21  9:15                   ` [PATCH v2] " Mike Galbraith

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.