diff options
Diffstat (limited to 'kernel/sched/cpufreq_schedutil.c')
-rw-r--r-- | kernel/sched/cpufreq_schedutil.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/kernel/sched/cpufreq_schedutil.c b/kernel/sched/cpufreq_schedutil.c index 636ca6f88c8e..867b4bb6d4be 100644 --- a/kernel/sched/cpufreq_schedutil.c +++ b/kernel/sched/cpufreq_schedutil.c | |||
@@ -40,6 +40,7 @@ struct sugov_policy { | |||
40 | struct task_struct *thread; | 40 | struct task_struct *thread; |
41 | bool work_in_progress; | 41 | bool work_in_progress; |
42 | 42 | ||
43 | bool limits_changed; | ||
43 | bool need_freq_update; | 44 | bool need_freq_update; |
44 | }; | 45 | }; |
45 | 46 | ||
@@ -89,8 +90,11 @@ static bool sugov_should_update_freq(struct sugov_policy *sg_policy, u64 time) | |||
89 | !cpufreq_this_cpu_can_update(sg_policy->policy)) | 90 | !cpufreq_this_cpu_can_update(sg_policy->policy)) |
90 | return false; | 91 | return false; |
91 | 92 | ||
92 | if (unlikely(sg_policy->need_freq_update)) | 93 | if (unlikely(sg_policy->limits_changed)) { |
94 | sg_policy->limits_changed = false; | ||
95 | sg_policy->need_freq_update = true; | ||
93 | return true; | 96 | return true; |
97 | } | ||
94 | 98 | ||
95 | delta_ns = time - sg_policy->last_freq_update_time; | 99 | delta_ns = time - sg_policy->last_freq_update_time; |
96 | 100 | ||
@@ -437,7 +441,7 @@ static inline bool sugov_cpu_is_busy(struct sugov_cpu *sg_cpu) { return false; } | |||
437 | static inline void ignore_dl_rate_limit(struct sugov_cpu *sg_cpu, struct sugov_policy *sg_policy) | 441 | static inline void ignore_dl_rate_limit(struct sugov_cpu *sg_cpu, struct sugov_policy *sg_policy) |
438 | { | 442 | { |
439 | if (cpu_bw_dl(cpu_rq(sg_cpu->cpu)) > sg_cpu->bw_dl) | 443 | if (cpu_bw_dl(cpu_rq(sg_cpu->cpu)) > sg_cpu->bw_dl) |
440 | sg_policy->need_freq_update = true; | 444 | sg_policy->limits_changed = true; |
441 | } | 445 | } |
442 | 446 | ||
443 | static void sugov_update_single(struct update_util_data *hook, u64 time, | 447 | static void sugov_update_single(struct update_util_data *hook, u64 time, |
@@ -457,7 +461,8 @@ static void sugov_update_single(struct update_util_data *hook, u64 time, | |||
457 | if (!sugov_should_update_freq(sg_policy, time)) | 461 | if (!sugov_should_update_freq(sg_policy, time)) |
458 | return; | 462 | return; |
459 | 463 | ||
460 | busy = sugov_cpu_is_busy(sg_cpu); | 464 | /* Limits may have changed, don't skip frequency update */ |
465 | busy = !sg_policy->need_freq_update && sugov_cpu_is_busy(sg_cpu); | ||
461 | 466 | ||
462 | util = sugov_get_util(sg_cpu); | 467 | util = sugov_get_util(sg_cpu); |
463 | max = sg_cpu->max; | 468 | max = sg_cpu->max; |
@@ -831,6 +836,7 @@ static int sugov_start(struct cpufreq_policy *policy) | |||
831 | sg_policy->last_freq_update_time = 0; | 836 | sg_policy->last_freq_update_time = 0; |
832 | sg_policy->next_freq = 0; | 837 | sg_policy->next_freq = 0; |
833 | sg_policy->work_in_progress = false; | 838 | sg_policy->work_in_progress = false; |
839 | sg_policy->limits_changed = false; | ||
834 | sg_policy->need_freq_update = false; | 840 | sg_policy->need_freq_update = false; |
835 | sg_policy->cached_raw_freq = 0; | 841 | sg_policy->cached_raw_freq = 0; |
836 | 842 | ||
@@ -879,7 +885,7 @@ static void sugov_limits(struct cpufreq_policy *policy) | |||
879 | mutex_unlock(&sg_policy->work_lock); | 885 | mutex_unlock(&sg_policy->work_lock); |
880 | } | 886 | } |
881 | 887 | ||
882 | sg_policy->need_freq_update = true; | 888 | sg_policy->limits_changed = true; |
883 | } | 889 | } |
884 | 890 | ||
885 | struct cpufreq_governor schedutil_gov = { | 891 | struct cpufreq_governor schedutil_gov = { |