[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20090402123834.14569.35435.stgit@sofia.in.ibm.com>
Date: Thu, 02 Apr 2009 18:08:34 +0530
From: Gautham R Shenoy <ego@...ibm.com>
To: "Ingo Molnar" <mingo@...e.hu>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>,
Vaidyanathan Srinivasan <svaidy@...ux.vnet.ibm.com>
Cc: linux-kernel@...r.kernel.org,
Suresh Siddha <suresh.b.siddha@...el.com>,
"Balbir Singh" <balbir@...ibm.com>,
Andi Kleen <andi@...stfloor.org>,
Gautham R Shenoy <ego@...ibm.com>
Subject: [PATCH v2 2/2] sched: Nominate a power-efficient ilb in
select_nohz_balancer()
The CPU that first goes idle becomes the idle-load-balancer and remains
that until either it picks up a task or till all the CPUs of the system
goes idle.
Optimize this further to allow it to relinquish it's post
once all it's siblings in the power-aware sched_domain go idle, thereby
allowing the whole package-core to go idle. While relinquising the post,
nominate another an idle-load balancer from a semi-idle core/package.
Signed-off-by: Gautham R Shenoy <ego@...ibm.com>
---
kernel/sched.c | 18 +++++++++++++++++-
1 files changed, 17 insertions(+), 1 deletions(-)
diff --git a/kernel/sched.c b/kernel/sched.c
index 4fc1ec0..c249473 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -4439,8 +4439,24 @@ int select_nohz_load_balancer(int stop_tick)
/* make me the ilb owner */
if (atomic_cmpxchg(&nohz.load_balancer, -1, cpu) == -1)
return 1;
- } else if (atomic_read(&nohz.load_balancer) == cpu)
+ } else if (atomic_read(&nohz.load_balancer) == cpu) {
+ int new_ilb;
+
+ if (!(sched_smt_power_savings ||
+ sched_mc_power_savings))
+ return 1;
+ /*
+ * Check to see if there is a more power-efficient
+ * ilb.
+ */
+ new_ilb = find_new_ilb(cpu);
+ if (new_ilb < nr_cpu_ids && new_ilb != cpu) {
+ atomic_set(&nohz.load_balancer, -1);
+ resched_cpu(new_ilb);
+ return 0;
+ }
return 1;
+ }
} else {
if (!cpumask_test_cpu(cpu, nohz.cpu_mask))
return 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