From 2bc0b27f24e92e67a5f93cdc6c48efaec213b4c8 Mon Sep 17 00:00:00 2001 From: Gautham R Shenoy Date: Tue, 14 Apr 2009 10:25:35 +0530 Subject: [PATCH] --- yaml --- r: 145705 b: refs/heads/master c: e790fb0ba64bfec158e1219d899cb588275d12ab h: refs/heads/master i: 145703: adc6ccc4c7b295c0c36967b0522ee842c328ce81 v: v3 --- [refs] | 2 +- trunk/kernel/sched.c | 18 +++++++++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 4a52a69d944d..efa1cb2c9783 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: f711f6090a81cbd396b63de90f415d33f563af9b +refs/heads/master: e790fb0ba64bfec158e1219d899cb588275d12ab diff --git a/trunk/kernel/sched.c b/trunk/kernel/sched.c index b0fefa300b40..36d213bca473 100644 --- a/trunk/kernel/sched.c +++ b/trunk/kernel/sched.c @@ -4414,8 +4414,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;