diff mbox series

cpufreq: schedutil: Remove the needless sg_policy parameter to ignore_dl_rate_limit()

Message ID 20210218090132.1556-1-zbestahu@gmail.com (mailing list archive)
State Mainlined, archived
Headers show
Series cpufreq: schedutil: Remove the needless sg_policy parameter to ignore_dl_rate_limit() | expand

Commit Message

Yue Hu Feb. 18, 2021, 9:01 a.m. UTC
From: Yue Hu <huyue2@yulong.com>

Since sg_policy is a member of struct sugov_cpu. Also remove the local
variable in sugov_update_single_common() to make the code more clean.

Signed-off-by: Yue Hu <huyue2@yulong.com>
---
 kernel/sched/cpufreq_schedutil.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

Comments

Rafael J. Wysocki Feb. 19, 2021, 3:11 p.m. UTC | #1
On Thu, Feb 18, 2021 at 10:24 AM Viresh Kumar <viresh.kumar@linaro.org> wrote:
>
> On 18-02-21, 17:01, Yue Hu wrote:
> > From: Yue Hu <huyue2@yulong.com>
> >
> > Since sg_policy is a member of struct sugov_cpu. Also remove the local
> > variable in sugov_update_single_common() to make the code more clean.
> >
> > Signed-off-by: Yue Hu <huyue2@yulong.com>
> > ---
> >  kernel/sched/cpufreq_schedutil.c | 12 +++++-------
> >  1 file changed, 5 insertions(+), 7 deletions(-)
>
> Acked-by: Viresh Kumar <viresh.kumar@linaro.org>

Applied as 5.12-rc material, thanks!
diff mbox series

Patch

diff --git a/kernel/sched/cpufreq_schedutil.c b/kernel/sched/cpufreq_schedutil.c
index 5906ae5..add8081 100644
--- a/kernel/sched/cpufreq_schedutil.c
+++ b/kernel/sched/cpufreq_schedutil.c
@@ -320,23 +320,21 @@  static bool sugov_cpu_is_busy(struct sugov_cpu *sg_cpu)
  * Make sugov_should_update_freq() ignore the rate limit when DL
  * has increased the utilization.
  */
-static inline void ignore_dl_rate_limit(struct sugov_cpu *sg_cpu, struct sugov_policy *sg_policy)
+static inline void ignore_dl_rate_limit(struct sugov_cpu *sg_cpu)
 {
 	if (cpu_bw_dl(cpu_rq(sg_cpu->cpu)) > sg_cpu->bw_dl)
-		sg_policy->limits_changed = true;
+		sg_cpu->sg_policy->limits_changed = true;
 }
 
 static inline bool sugov_update_single_common(struct sugov_cpu *sg_cpu,
 					      u64 time, unsigned int flags)
 {
-	struct sugov_policy *sg_policy = sg_cpu->sg_policy;
-
 	sugov_iowait_boost(sg_cpu, time, flags);
 	sg_cpu->last_update = time;
 
-	ignore_dl_rate_limit(sg_cpu, sg_policy);
+	ignore_dl_rate_limit(sg_cpu);
 
-	if (!sugov_should_update_freq(sg_policy, time))
+	if (!sugov_should_update_freq(sg_cpu->sg_policy, time))
 		return false;
 
 	sugov_get_util(sg_cpu);
@@ -452,7 +450,7 @@  static unsigned int sugov_next_freq_shared(struct sugov_cpu *sg_cpu, u64 time)
 	sugov_iowait_boost(sg_cpu, time, flags);
 	sg_cpu->last_update = time;
 
-	ignore_dl_rate_limit(sg_cpu, sg_policy);
+	ignore_dl_rate_limit(sg_cpu);
 
 	if (sugov_should_update_freq(sg_policy, time)) {
 		next_f = sugov_next_freq_shared(sg_cpu, time);