[RFC PATCH V2 14/19] sched: add power/performance balance allow flag
From: Preeti U Murthy
Date: Mon Aug 11 2014 - 07:41:28 EST
From: Alex Shi <alex.shi@xxxxxxxxx>
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@xxxxxxxxx>
[Added CONFIG_SCHED_POWER switch to enable this patch]
Signed-off-by: Preeti U Murthy <preeti@xxxxxxxxxxxxxxxxxx>
---
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,
};
--
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/