[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJZ5v0gXOfTrEeu=HEeC6=JowbcaC+cdDsDyc40s1SdQJas2LQ@mail.gmail.com>
Date: Mon, 23 Nov 2020 11:29:26 +0100
From: "Rafael J. Wysocki" <rafael@...nel.org>
To: Viresh Kumar <viresh.kumar@...aro.org>
Cc: "Rafael J. Wysocki" <rafael@...nel.org>,
Ingo Molnar <mingo@...hat.com>,
Peter Zijlstra <peterz@...radead.org>,
Vincent Guittot <vincent.guittot@...aro.org>,
Juri Lelli <juri.lelli@...hat.com>,
Dietmar Eggemann <dietmar.eggemann@....com>,
Steven Rostedt <rostedt@...dmis.org>,
Ben Segall <bsegall@...gle.com>, Mel Gorman <mgorman@...e.de>,
Daniel Bristot de Oliveira <bristot@...hat.com>,
"Rafael J. Wysocki" <rjw@...ysocki.net>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Quentin Perret <qperret@...gle.com>,
Lukasz Luba <lukasz.luba@....com>,
Linux PM <linux-pm@...r.kernel.org>
Subject: Re: [PATCH V3 1/2] sched/core: Rename and move schedutil_cpu_util()
to core.c
On Mon, Nov 23, 2020 at 11:05 AM Viresh Kumar <viresh.kumar@...aro.org> wrote:
>
> On 19-11-20, 13:30, Rafael J. Wysocki wrote:
> > On Thu, Nov 19, 2020 at 8:38 AM Viresh Kumar <viresh.kumar@...aro.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 ?
Right.
Powered by blists - more mailing lists