[RFC][PATCH 4/9] sched: Make periodic load-balance disregard cpus with a cpu_power of 1

From: Morten Rasmussen
Date: Tue Jul 09 2013 - 11:58:23 EST


Some of the load_balance() helper functions will put tasks on cpus with
cpu_power=1 when they are completely idle. This patch changes this behaviour.

The patch is a quick fix. The load_balance() helper functions should be
revisited to implement proper handling of cpus with cpu_power=1.

Signed-off-by: Morten Rasmussen <morten.rasmussen@xxxxxxx>
CC: Ingo Molnar <mingo@xxxxxxxxxx>
CC: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
CC: Catalin Marinas <catalin.marinas@xxxxxxx>
---
kernel/sched/fair.c | 12 ++++++++++++
1 file changed, 12 insertions(+)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index f637ea5..4610463 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -3952,6 +3952,13 @@ int can_migrate_task(struct task_struct *p, struct lb_env *env)
}

/*
+ * Vacate cpus disabled by the power scheduler even if the cache is
+ * hot
+ */
+ if (!power_cpu_balance(env->src_cpu))
+ return 1;
+
+ /*
* Aggressive migration if:
* 1) task is cache cold, or
* 2) too many balance attempts have failed.
@@ -4500,6 +4507,11 @@ static inline void update_sg_lb_stats(struct lb_env *env,
update_group_power(env->sd, env->dst_cpu);
} else if (time_after_eq(jiffies, group->sgp->next_update))
update_group_power(env->sd, env->dst_cpu);
+
+ if (!power_cpu_balance(env->dst_cpu)) {
+ *balance = 0;
+ return;
+ }
}

/* Adjust by relative CPU power of the group */
--
1.7.9.5


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/