linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rafael@kernel.org>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>,
	Ingo Molnar <mingo@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	Juri Lelli <juri.lelli@redhat.com>,
	Dietmar Eggemann <dietmar.eggemann@arm.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Ben Segall <bsegall@google.com>, Mel Gorman <mgorman@suse.de>,
	Daniel Bristot de Oliveira <bristot@redhat.com>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Quentin Perret <qperret@google.com>,
	Lukasz Luba <lukasz.luba@arm.com>,
	Linux PM <linux-pm@vger.kernel.org>
Subject: Re: [PATCH V3 1/2] sched/core: Rename and move schedutil_cpu_util() to core.c
Date: Mon, 23 Nov 2020 11:29:26 +0100	[thread overview]
Message-ID: <CAJZ5v0gXOfTrEeu=HEeC6=JowbcaC+cdDsDyc40s1SdQJas2LQ@mail.gmail.com> (raw)
In-Reply-To: <20201123100455.ulpoje32hhrmskou@vireshk-i7>

On Mon, Nov 23, 2020 at 11:05 AM Viresh Kumar <viresh.kumar@linaro.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@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 ?

Right.

  reply	other threads:[~2020-11-23 10:30 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-19  7:38 [PATCH V3 0/2] cpufreq_cooling: Get effective CPU utilization from scheduler Viresh Kumar
2020-11-19  7:38 ` [PATCH V3 1/2] sched/core: Rename and move schedutil_cpu_util() to core.c Viresh Kumar
2020-11-19 12:30   ` Rafael J. Wysocki
2020-11-23 10:04     ` Viresh Kumar
2020-11-23 10:29       ` Rafael J. Wysocki [this message]
2020-11-19  7:38 ` [PATCH V3 2/2] thermal: cpufreq_cooling: Reuse sched_cpu_util() for SMP platforms Viresh Kumar
2020-11-20 14:51   ` Lukasz Luba
2020-11-23 10:41     ` Viresh Kumar
2020-11-23 11:34       ` Lukasz Luba
2020-11-23 15:32   ` Lukasz Luba
2020-11-24  4:56     ` Viresh Kumar
2020-12-01 17:25   ` Valentin Schneider
2020-12-07  9:13     ` Viresh Kumar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAJZ5v0gXOfTrEeu=HEeC6=JowbcaC+cdDsDyc40s1SdQJas2LQ@mail.gmail.com' \
    --to=rafael@kernel.org \
    --cc=bristot@redhat.com \
    --cc=bsegall@google.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=lukasz.luba@arm.com \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=qperret@google.com \
    --cc=rjw@rjwysocki.net \
    --cc=rostedt@goodmis.org \
    --cc=vincent.guittot@linaro.org \
    --cc=viresh.kumar@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).