mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dietmar Eggemann <dietmar.eggemann@arm.com>
To: Vincent Guittot <vincent.guittot@linaro.org>
Cc: Ingo Molnar <mingo@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Juri Lelli <juri.lelli@redhat.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Ben Segall <bsegall@google.com>, Mel Gorman <mgorman@suse.de>,
	Daniel Bristot de Oliveira <bristot@redhat.com>,
	Valentin Schneider <Valentin.Schneider@arm.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] sched/fair: Replace CFS internal cpu_util() with cpu_util_cfs()
Date: Thu, 18 Nov 2021 17:17:15 +0100	[thread overview]
Message-ID: <2a800d9c-2dfc-e901-da46-5f858d6abd57@arm.com> (raw)
In-Reply-To: <CAKfTPtBZdpxMPP4-uRqmCxavKosf4NL14SF1S6=mrKJjVfX+Pw@mail.gmail.com>

On 18.11.21 09:07, Vincent Guittot wrote:
> On Wed, 17 Nov 2021 at 18:26, Dietmar Eggemann <dietmar.eggemann@arm.com> wrote:
>>
>> On 12.11.21 17:20, Vincent Guittot wrote:
>>> On Fri, 12 Nov 2021 at 15:14, Dietmar Eggemann <dietmar.eggemann@arm.com> wrote:
>>>>
>>>> cpu_util_cfs() was created by commit d4edd662ac16 ("sched/cpufreq: Use
>>>> the DEADLINE utilization signal") to enable the access to CPU
>>>> utilization from the Schedutil CPUfreq governor.
>>>>
>>>> Commit a07630b8b2c1 ("sched/cpufreq/schedutil: Use util_est for OPP
>>>> selection") added util_est support later.
>>>>
>>>> The only thing cpu_util() is doing on top of what cpu_util_cfs() already
>>>> does is to clamp the return value to the [0..capacity_orig] capacity
>>>> range of the CPU. Integrating this into cpu_util_cfs() is not harming
>>>> the existing users (Schedutil and CPUfreq cooling (latter via
>>>> sched_cpu_util() wrapper)).
>>>
>>> Could you to update cpu_util_cfs() to use cpu as a parameter instead of rq ?
>>
>> I could but I decided to use use `struct rq *rq` instead.
>>
>> (A) We already know the rq in the following functions where we call
>>     cpu_util_cfs():
> 
> The only user of cpu_util_cfs() is sugov_get_util() and it does
> cpu_util_cfs(cpu_rq(sg_cpu->cpu)) because rq is only used as a
> parameter of cpu_util_cfs()

Sure, I guess there is another user currently: cpufreq_cooling

get_load() -> sched_cpu_util() ->
effective_cpu_util(..., cpu_util_cfs(cpu_rq(cpu)), ...)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^
> 
> all other ones are using cpu_util() which already uses cpu as a
> parameter so it's more straight forward to keep using cpu

OK, will do it this way, just wanted to mention the possibility to save
some of these cpu_rq(cpu) calls.

[...]

>> /**
>>  * cpu_util_cfs() - Estimates the amount of CPU capacity used by CFS tasks.
>>  * @cpu: the CPU to get the utilization for.
> 
> cpu is clearly the right parameter ;-)

Not very clever of me ;-)

[...]

      reply	other threads:[~2021-11-18 16:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-12 14:13 Dietmar Eggemann
2021-11-12 16:20 ` Vincent Guittot
2021-11-17 17:26   ` Dietmar Eggemann
2021-11-18  8:07     ` Vincent Guittot
2021-11-18 16:17       ` Dietmar Eggemann [this message]

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=2a800d9c-2dfc-e901-da46-5f858d6abd57@arm.com \
    --to=dietmar.eggemann@arm.com \
    --cc=Valentin.Schneider@arm.com \
    --cc=bristot@redhat.com \
    --cc=bsegall@google.com \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=vincent.guittot@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

all inboxes | Powered by JetHome®