diff options
| author | Pavankumar Kondeti <pkondeti@codeaurora.org> | 2015-04-10 15:10:56 +0530 |
|---|---|---|
| committer | David Keitel <dkeitel@codeaurora.org> | 2016-03-23 20:01:59 -0700 |
| commit | c17d7d3c4033e4ccb1022930d88e655230dbc79b (patch) | |
| tree | d73f1e13fd89be32c1ef67e186e2e3c2c9312efa /kernel/sched/core.c | |
| parent | 37921ca6be838402cbd6cb408a7a3f7aa5cea6f7 (diff) | |
sched: auto adjust the upmigrate and downmigrate thresholds
The load scale factor of a CPU gets boosted when its max freq
is restricted. A task load at the same frequency is scaled higher
than normal under this scenario. This results in tasks migrating
early to the better capacity CPUs and their residency over there
also gets increased as their inflated load would be relatively
higher than than the downmigrate threshold.
Auto adjust the upmigrate and downmigrate thresholds by a factor
equal to rq->max_possible_freq/rq->max_freq of a lower capacity CPU.
If the adjusted upmigrate threshold exceeds the window size, it is
clipped to the window size. If the adjusted downmigrate threshold
decreases the difference between the upmigrate and downmigrate, it is
clipped to a value such that the difference between the modified
and the original thresholds is same.
Change-Id: Ifa70ee5d4ca5fe02789093c7f070c77629907f04
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
Diffstat (limited to 'kernel/sched/core.c')
| -rw-r--r-- | kernel/sched/core.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/kernel/sched/core.c b/kernel/sched/core.c index b670bc883f91..e877e761fac5 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -2410,6 +2410,27 @@ static int compute_load_scale_factor(int cpu) return load_scale; } +#define sched_up_down_migrate_auto_update 1 +static void check_for_up_down_migrate_update(const struct cpumask *cpus) +{ + int i = cpumask_first(cpus); + struct rq *rq = cpu_rq(i); + + if (!sched_up_down_migrate_auto_update) + return; + + if (rq->max_possible_capacity == max_possible_capacity) + return; + + if (rq->max_possible_freq == rq->max_freq) + up_down_migrate_scale_factor = 1024; + else + up_down_migrate_scale_factor = (1024 * rq->max_possible_freq)/ + rq->max_freq; + + update_up_down_migrate(); +} + static int cpufreq_notifier_policy(struct notifier_block *nb, unsigned long val, void *data) { @@ -2512,6 +2533,7 @@ static int cpufreq_notifier_policy(struct notifier_block *nb, } __update_min_max_capacity(); + check_for_up_down_migrate_update(policy->related_cpus); post_big_small_task_count_change(cpu_possible_mask); return 0; |
