aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMorten Rasmussen <morten.rasmussen@arm.com>2015-01-02 17:08:52 +0000
committerRobin Randhawa <robin.randhawa@arm.com>2015-04-09 12:26:13 +0100
commitb1ce261ab0e1eae95cfee5da460b55fa6a1a154e (patch)
treeabafebd9d493a618a4428b3fe94c1fd6dfae4ec0
parent00895743ca591446a82cbc44ec6daa91612b4224 (diff)
downloadkernel-b1ce261ab0e1eae95cfee5da460b55fa6a1a154e.tar.gz
sched: Highest energy aware balancing sched_domain level pointer
Add another member to the family of per-cpu sched_domain shortcut pointers. This one, sd_ea, points to the highest level at which energy model is provided. At this level and all levels below all sched_groups have energy model data attached. cc: Ingo Molnar <mingo@redhat.com> cc: Peter Zijlstra <peterz@infradead.org> Signed-off-by: Morten Rasmussen <morten.rasmussen@arm.com>
-rw-r--r--kernel/sched/core.c11
-rw-r--r--kernel/sched/sched.h1
2 files changed, 11 insertions, 1 deletions
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 17c02cc1f10a..12cb272dc607 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -4760,6 +4760,7 @@ DEFINE_PER_CPU(int, sd_llc_size);
DEFINE_PER_CPU(int, sd_llc_id);
DEFINE_PER_CPU(struct sched_domain *, sd_busy);
DEFINE_PER_CPU(struct sched_domain *, sd_asym);
+DEFINE_PER_CPU(struct sched_domain *, sd_ea);
#ifdef CONFIG_NUMA_BALANCING
DEFINE_PER_CPU(struct sched_domain *, sd_numa);
#endif
@@ -4767,7 +4768,7 @@ DEFINE_PER_CPU(struct sched_domain *, sd_numa);
static void update_top_cache_domain(int cpu)
{
struct sched_domain *sd;
- struct sched_domain *busy_sd = NULL;
+ struct sched_domain *busy_sd = NULL, *ea_sd = NULL;
int id = cpu;
int size = 1;
@@ -4790,6 +4791,14 @@ static void update_top_cache_domain(int cpu)
sd = highest_flag_domain(cpu, SD_ASYM_PACKING);
rcu_assign_pointer(per_cpu(sd_asym, cpu), sd);
+
+ for_each_domain(cpu, sd) {
+ if (sd->groups->sge)
+ ea_sd = sd;
+ else
+ break;
+ }
+ rcu_assign_pointer(per_cpu(sd_ea, cpu), ea_sd);
}
/*
diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
index 880583a11c87..e49cb6b85b90 100644
--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
@@ -602,6 +602,7 @@ DECLARE_PER_CPU(int, sd_llc_id);
DECLARE_PER_CPU(struct sched_domain *, sd_numa);
DECLARE_PER_CPU(struct sched_domain *, sd_busy);
DECLARE_PER_CPU(struct sched_domain *, sd_asym);
+DECLARE_PER_CPU(struct sched_domain *, sd_ea);
struct sched_group_capacity {
atomic_t ref;