diff options
author | Linux Build Service Account <lnxbuild@localhost> | 2016-09-30 18:23:48 -0700 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2016-09-30 18:23:48 -0700 |
commit | 818156d2ac407c3f25caa43014994608616b08c6 (patch) | |
tree | 3195d12d19c88e477f5cfb49698bd2ddb610b2e4 /kernel/sched | |
parent | 627381d09a60fdd30bb26fe3868afb8568b6b3ae (diff) | |
parent | 9d128dbca33500c066648db5d9054263272d6e83 (diff) |
Merge "sched: don't assume higher capacity means higher power in lb"
Diffstat (limited to 'kernel/sched')
-rw-r--r-- | kernel/sched/fair.c | 10 | ||||
-rw-r--r-- | kernel/sched/hmp.c | 7 | ||||
-rw-r--r-- | kernel/sched/sched.h | 1 |
3 files changed, 10 insertions, 8 deletions
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 83da13b5f6b8..14b8977d1be4 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -7229,9 +7229,7 @@ bail_inter_cluster_balance(struct lb_env *env, struct sd_lb_stats *sds) local_pwr_cost = cpu_max_power_cost(local_cpu); busiest_pwr_cost = cpu_max_power_cost(busiest_cpu); - if (local_capacity < busiest_capacity || - (local_capacity == busiest_capacity && - local_pwr_cost <= busiest_pwr_cost)) + if (local_pwr_cost <= busiest_pwr_cost) return 0; if (local_capacity > busiest_capacity && @@ -8868,9 +8866,6 @@ static inline int find_new_hmp_ilb(int type) for_each_cpu_and(ilb, nohz.idle_cpus_mask, sched_domain_span(sd)) { if (idle_cpu(ilb) && (type != NOHZ_KICK_RESTRICT || - (hmp_capable() && - cpu_max_possible_capacity(ilb) <= - cpu_max_possible_capacity(call_cpu)) || cpu_max_power_cost(ilb) <= cpu_max_power_cost(call_cpu))) { rcu_read_unlock(); @@ -9224,8 +9219,7 @@ static inline int _nohz_kick_needed_hmp(struct rq *rq, int cpu, int *type) if (!sysctl_sched_restrict_cluster_spill || sched_boost()) return 1; - if (hmp_capable() && cpu_max_possible_capacity(cpu) == - max_possible_capacity) + if (cpu_max_power_cost(cpu) == max_power_cost) return 1; rcu_read_lock(); diff --git a/kernel/sched/hmp.c b/kernel/sched/hmp.c index 6e1757aa1541..3bbf3ee46cf9 100644 --- a/kernel/sched/hmp.c +++ b/kernel/sched/hmp.c @@ -357,6 +357,8 @@ DECLARE_BITMAP(all_cluster_ids, NR_CPUS); struct sched_cluster *sched_cluster[NR_CPUS]; int num_clusters; +unsigned int max_power_cost = 1; + struct sched_cluster init_cluster = { .list = LIST_HEAD_INIT(init_cluster.list), .id = 0, @@ -466,6 +468,7 @@ static void sort_clusters(void) { struct sched_cluster *cluster; struct list_head new_head; + unsigned int tmp_max = 1; INIT_LIST_HEAD(&new_head); @@ -474,7 +477,11 @@ static void sort_clusters(void) max_task_load()); cluster->min_power_cost = power_cost(cluster_first_cpu(cluster), 0); + + if (cluster->max_power_cost > tmp_max) + tmp_max = cluster->max_power_cost; } + max_power_cost = tmp_max; move_list(&new_head, &cluster_head, true); diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index 41abb4dabeb7..038d79dda2f2 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -1039,6 +1039,7 @@ extern unsigned int min_capacity; extern unsigned int max_load_scale_factor; extern unsigned int max_possible_capacity; extern unsigned int min_max_possible_capacity; +extern unsigned int max_power_cost; extern unsigned int sched_upmigrate; extern unsigned int sched_downmigrate; extern unsigned int sched_init_task_load_windows; |