lkml.org 
[lkml]   [2013]   [Apr]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[patch v7 14/21] sched: add power/performance balance allow flag
Date
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>
---
kernel/sched/fair.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 6145ed2..f861427 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -4013,6 +4013,8 @@ static unsigned long __read_mostly max_load_balance_interval = HZ/10;
#define LBF_ALL_PINNED 0x01
#define LBF_NEED_BREAK 0x02
#define LBF_SOME_PINNED 0x04
+#define LBF_POWER_BAL 0x08 /* if power balance allowed */
+#define LBF_PERF_BAL 0x10 /* if performance balance allowed */

struct lb_env {
struct sched_domain *sd;
@@ -5175,6 +5177,7 @@ static int load_balance(int this_cpu, struct rq *this_rq,
.idle = idle,
.loop_break = sched_nr_migrate_break,
.cpus = cpus,
+ .flags = LBF_PERF_BAL,
};

cpumask_copy(cpus, cpu_active_mask);
--
1.7.12


\
 
 \ /
  Last update: 2013-04-04 05:21    [W:0.115 / U:10.976 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site