Re: [PATCH v1 1/4] cpufreq: schedutil: Add util to struct sg_cpu

From: Rafael J. Wysocki
Date: Wed Dec 09 2020 - 12:19:05 EST


On Tue, Dec 8, 2020 at 9:34 AM Viresh Kumar <viresh.kumar@xxxxxxxxxx> wrote:
>
> On 07-12-20, 17:28, Rafael J. Wysocki wrote:
> > From: Rafael J. Wysocki <rafael.j.wysocki@xxxxxxxxx>
> >
> > Instead of passing util and max between functions while computing the
> > utilization and capacity, store the former in struct sg_cpu (along
> > with the latter and bw_dl).
> >
> > This will allow the current utilization value to be compared with the
> > one obtained previously (which is requisite for some code changes to
> > follow this one), but also it makes the code look slightly more
> > consistent and clean.
> >
> > Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@xxxxxxxxx>
> > ---
> > kernel/sched/cpufreq_schedutil.c | 42 ++++++++++++++++++---------------------
> > 1 file changed, 20 insertions(+), 22 deletions(-)
> >
> > Index: linux-pm/kernel/sched/cpufreq_schedutil.c
> > ===================================================================
> > --- linux-pm.orig/kernel/sched/cpufreq_schedutil.c
> > +++ linux-pm/kernel/sched/cpufreq_schedutil.c
> > @@ -53,6 +53,7 @@ struct sugov_cpu {
> > unsigned int iowait_boost;
> > u64 last_update;
> >
> > + unsigned long util;
> > unsigned long bw_dl;
> > unsigned long max;
> >
> > @@ -276,16 +277,15 @@ unsigned long schedutil_cpu_util(int cpu
> > return min(max, util);
> > }
> >
> > -static unsigned long sugov_get_util(struct sugov_cpu *sg_cpu)
> > +static void sugov_get_util(struct sugov_cpu *sg_cpu)
>
> Maybe name it sugov_update_util() ?

That might be somewhat confusing due to the existing meaning of "update_util".

> Otherwise,
>
> Acked-by: Viresh Kumar <viresh.kumar@xxxxxxxxxx>

Thanks!