diff mbox

[RFC,2/3] sched: fix init NOHZ_IDLE flag

Message ID 1353343087-18015-3-git-send-email-vincent.guittot@linaro.org
State Not Applicable
Headers show

Commit Message

Vincent Guittot Nov. 19, 2012, 4:38 p.m. UTC
On my smp platform which is made of 5 cores in 2 clusters,I have the
nr_busy_cpu field of sched_group_power struct that is not null when the
platform is fully idle. The root cause seems to be:
During the boot sequence, some CPUs reach the idle loop and set their
NOHZ_IDLE flag while waiting for others CPUs to boot. But the nr_busy_cpus
field is initialized later with the assumption that all CPUs are in the busy
state whereas some CPUs have already set their NOHZ_IDLE flag.
We clear the NOHZ_IDLE flag when nr_busy_cpus is initialized in order to 
have a coherent configuration.

Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
---
 kernel/sched/core.c |    1 +
 1 file changed, 1 insertion(+)
diff mbox

Patch

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 5dae0d2..05058e8 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -5817,6 +5817,7 @@  static void init_sched_groups_power(int cpu, struct sched_domain *sd)
 
 	update_group_power(sd, cpu);
 	atomic_set(&sg->sgp->nr_busy_cpus, sg->group_weight);
+	clear_bit(NOHZ_IDLE, nohz_flags(cpu));
 }
 
 int __weak arch_sd_sibling_asym_packing(void)