From: Alex Shi alex.shi@intel.com
If a sched domain is idle enough for regular power balance, LBF_POWER_BAL will be set, LBF_PERF_BAL will be clean. If a sched domain is busy, their value will be set oppositely.
If the domain is suitable for power balance, but balance should not be down by this cpu(this cpu is already idle or full), both of flags are cleared to wait a suitable cpu to do power balance. That mean no any balance, neither power balance nor performance balance will be done on this cpu.
Above logical will be implemented by incoming patches.
Signed-off-by: Alex Shi alex.shi@intel.com [Added CONFIG_SCHED_POWER switch to enable this patch] Signed-off-by: Preeti U Murthy preeti@linux.vnet.ibm.com ---
kernel/sched/fair.c | 8 ++++++++ 1 file changed, 8 insertions(+)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index e7a677e..f9b2a21 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -5372,6 +5372,11 @@ enum fbq_type { regular, remote, all }; #define LBF_DST_PINNED 0x04 #define LBF_SOME_PINNED 0x08
+#ifdef CONFIG_SCHED_POWER +#define LBF_POWER_BAL 0x08 /* if power balance allowed */ +#define LBF_PERF_BAL 0x10 /* if performance balance allowed */ +#endif + struct lb_env { struct sched_domain *sd;
@@ -6866,6 +6871,9 @@ static int load_balance(int this_cpu, struct rq *this_rq, .idle = idle, .loop_break = sched_nr_migrate_break, .cpus = cpus, +#ifdef CONFIG_SCHED_POWER + .flags = LBF_PERF_BAL, +#endif .fbq_type = all, };