lkml.org 
[lkml]   [2020]   [Nov]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH V3 1/2] sched/core: Rename and move schedutil_cpu_util() to core.c
On 19-11-20, 13:30, Rafael J. Wysocki wrote:
> On Thu, Nov 19, 2020 at 8:38 AM Viresh Kumar <viresh.kumar@linaro.org> wrote:
> >
> > There is nothing schedutil specific in schedutil_cpu_util(), move it to
> > core.c and rename it to sched_cpu_util(), so it can be used from other
> > parts of the kernel as well.
>
> The patch does more than this, though.
>
> I would do that in two patches: (1) move the function as is and (2)
> rename it and rearrange the users.

Sure.

> > static unsigned long sugov_get_util(struct sugov_cpu *sg_cpu)
> > {
> > - struct rq *rq = cpu_rq(sg_cpu->cpu);
> > - unsigned long util = cpu_util_cfs(rq);
> > - unsigned long max = arch_scale_cpu_capacity(sg_cpu->cpu);
> > -
> > - sg_cpu->max = max;
> > - sg_cpu->bw_dl = cpu_bw_dl(rq);
> > + sg_cpu->max = arch_scale_cpu_capacity(sg_cpu->cpu);
> > + sg_cpu->bw_dl = cpu_bw_dl(cpu_rq(sg_cpu->cpu));
> >
> > - return schedutil_cpu_util(sg_cpu->cpu, util, max, FREQUENCY_UTIL, NULL);
> > + return sched_cpu_util(sg_cpu->cpu, FREQUENCY_UTIL, sg_cpu->max);
>
> I don't see much value in using this wrapper here TBH and it
> introduces an otherwise redundant cpu_rq() computation.

You want to call effective_cpu_util() here instead, right ?

--
viresh

\
 
 \ /
  Last update: 2020-11-23 11:06    [W:0.053 / U:0.132 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site