diff options
| author | Dietmar Eggemann <dietmar.eggemann@arm.com> | 2015-05-07 18:46:15 +0100 |
|---|---|---|
| committer | Amit Pundir <amit.pundir@linaro.org> | 2016-09-14 14:48:50 +0530 |
| commit | 50df3f37c6642460c4625ccd2fffff17ec534c5b (patch) | |
| tree | 67d2851eea68fd0a01bc7077b04a206887a172b9 | |
| parent | 49e029d7a7355ee5d44bbb906606c08cb4133ba3 (diff) | |
sched: Store system-wide maximum cpu capacity in root domain
To be able to compare the capacity of the target cpu with the highest
cpu capacity of the system in the wakeup path, store the system-wide
maximum cpu capacity in the root domain.
cc: Ingo Molnar <mingo@redhat.com>
cc: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
| -rw-r--r-- | kernel/sched/core.c | 8 | ||||
| -rw-r--r-- | kernel/sched/sched.h | 3 |
2 files changed, 11 insertions, 0 deletions
diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 6f6c7cc13f33..8bf755697230 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -6975,6 +6975,7 @@ static int build_sched_domains(const struct cpumask *cpu_map, enum s_alloc alloc_state; struct sched_domain *sd; struct s_data d; + struct rq *rq = NULL; int i, ret = -ENOMEM; alloc_state = __visit_domain_allocation_hell(&d, cpu_map); @@ -7025,11 +7026,18 @@ static int build_sched_domains(const struct cpumask *cpu_map, /* Attach the domains */ rcu_read_lock(); for_each_cpu(i, cpu_map) { + rq = cpu_rq(i); sd = *per_cpu_ptr(d.sd, i); cpu_attach_domain(sd, d.rd, i); + + if (rq->cpu_capacity_orig > rq->rd->max_cpu_capacity) + rq->rd->max_cpu_capacity = rq->cpu_capacity_orig; } rcu_read_unlock(); + if (rq) + pr_info("max cpu_capacity %lu\n", rq->rd->max_cpu_capacity); + ret = 0; error: __free_domain_allocs(&d, alloc_state, cpu_map); diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index 0517abd7dd73..412a072da775 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -543,6 +543,9 @@ struct root_domain { */ cpumask_var_t rto_mask; struct cpupri cpupri; + + /* Maximum cpu capacity in the system. */ + unsigned long max_cpu_capacity; }; extern struct root_domain def_root_domain; |
