acpica-devel.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Vincent Guittot <vincent.guittot@linaro.org>
To: Dietmar Eggemann <dietmar.eggemann@arm.com>
Cc: juri.lelli@redhat.com, peterz@infradead.org,
	catalin.marinas@arm.com, robert.moore@intel.com,
	bsegall@google.com, conor.dooley@microchip.com,
	pierre.gondois@arm.com, linux-riscv@lists.infradead.org,
	will@kernel.org, acpica-devel@lists.linuxfoundation.org,
	vschneid@redhat.com, ajones@ventanamicro.com,
	linux@armlinux.org.uk, linux-acpi@vger.kernel.org,
	mingo@redhat.com, bristot@redhat.com, lftan@kernel.org,
	viresh.kumar@linaro.org, mgorman@suse.de, aou@eecs.berkeley.edu,
	linux-pm@vger.kernel.org, rostedt@goodmis.org,
	paul.walmsley@sifive.com, linux-arm-kernel@lists.infradead.org,
	gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org,
	palmer@dabbelt.com, sudeep.holla@arm.com, suagrfillet@gmail.com,
	lenb@kernel.org, ionela.voinescu@arm.com, lukasz.luba@arm.com
Subject: Re: [Acpica-devel] [PATCH v3 3/6] cpufreq/schedutil: use a fixed reference frequency
Date: Thu, 26 Oct 2023 17:13:31 +0200	[thread overview]
Message-ID: <CAKfTPtBJRT56dL7+UW-viZuK3wKfGimQfrkvtuCQ_20g4N5LPQ@mail.gmail.com> (raw)
In-Reply-To: <f5e398f3-fbb7-4840-9084-14c8254b2118@arm.com>

On Wed, 25 Oct 2023 at 22:13, Dietmar Eggemann <dietmar.eggemann@arm.com> wrote:
>
> On 18/10/2023 18:25, Vincent Guittot wrote:
> > cpuinfo.max_freq can change at runtime because of boost as an example. This
> > implies that the value could be different than the one that has been
> > used when computing the capacity of a CPU.
> >
> > The new arch_scale_freq_ref() returns a fixed and coherent reference
> > frequency that can be used when computing a frequency based on utilization.
> >
> > Use this arch_scale_freq_ref() when available and fallback to
> > policy otherwise.
> >
> > Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
> > Reviewed-by: Lukasz Luba <lukasz.luba@arm.com>
> > Tested-by: Lukasz Luba <lukasz.luba@arm.com>
> >
> > ---
> >  kernel/sched/cpufreq_schedutil.c | 26 ++++++++++++++++++++++++--
> >  1 file changed, 24 insertions(+), 2 deletions(-)
> >
> > diff --git a/kernel/sched/cpufreq_schedutil.c b/kernel/sched/cpufreq_schedutil.c
> > index 458d359f5991..6e4030482ae8 100644
> > --- a/kernel/sched/cpufreq_schedutil.c
> > +++ b/kernel/sched/cpufreq_schedutil.c
> > @@ -114,6 +114,28 @@ static void sugov_deferred_update(struct sugov_policy *sg_policy)
> >       }
> >  }
> >
> > +/**
> > + * cpufreq_get_capacity_ref_freq - get the reference frequency of a given CPU that
>
> s/cpufreq_get_capacity_ref_freq/get_capacity_ref_freq
>
> s/of a given CPU/for a given cpufreq policy ? (of which the CPU managing
> it is used for the arch_scale_freq_ref() call in the function.
>
> > + * has been used to correlate frequency and compute capacity.
> > + * @policy: the cpufreq policy of the CPU in question.
> > + * @use_current: Fallback to current freq instead of policy->cpuinfo.max_freq.
>
> Looks like use_current does not exists as a parameter.

Thanks for the review. I'm going to apply your comments

>
> > + *
> > + * Return: the reference CPU frequency to compute a capacity.
> > + */
> > +static __always_inline
> > +unsigned long get_capacity_ref_freq(struct cpufreq_policy *policy)
> > +{
> > +     unsigned int freq = arch_scale_freq_ref(policy->cpu);
> > +
> > +     if (freq)
> > +             return freq;
> > +
> > +     if (arch_scale_freq_invariant())
> > +             return policy->cpuinfo.max_freq;
> > +
> > +     return policy->cur;
> > +}
>
> Reviewed-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
>
>
>

  reply	other threads:[~2023-10-26 15:13 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-18 16:25 [Acpica-devel] [PATCH v3 0/6] consolidate and cleanup CPU capacity Vincent Guittot
2023-10-18 16:25 ` [Acpica-devel] [PATCH v3 1/6] topology: add a new arch_scale_freq_reference Vincent Guittot
2023-10-18 16:25 ` [Acpica-devel] [PATCH v3 2/6] cpufreq: use the fixed and coherent frequency for scaling capacity Vincent Guittot
2023-10-18 17:23   ` Rafael J. Wysocki
2023-10-18 16:25 ` [Acpica-devel] [PATCH v3 3/6] cpufreq/schedutil: use a fixed reference frequency Vincent Guittot
2023-10-18 17:22   ` Rafael J. Wysocki
2023-10-25 11:53   ` Peter Zijlstra
2023-10-25 12:51     ` Vincent Guittot
2023-10-25 20:13   ` Dietmar Eggemann
2023-10-26 15:13     ` Vincent Guittot [this message]
2023-10-18 16:25 ` [Acpica-devel] [PATCH v3 4/6] energy_model: " Vincent Guittot
2023-10-25 11:54   ` Peter Zijlstra
2023-10-25 12:11     ` Peter Zijlstra
2023-10-25 12:24       ` Rafael J. Wysocki
2023-10-25 12:54     ` Vincent Guittot
2023-10-18 16:25 ` [Acpica-devel] [PATCH v3 5/6] cpufreq/cppc: set the frequency used for computing the capacity Vincent Guittot
2023-10-18 17:27   ` Rafael J. Wysocki
2023-10-20 16:05     ` Pierre Gondois
2023-10-24  9:56       ` Vincent Guittot
2023-10-18 16:25 ` [Acpica-devel] [RFC v3 6/6] arm64/amu: use capacity_ref_freq to set AMU ratio Vincent Guittot
2023-10-23 20:58   ` Ionela Voinescu
2023-10-24  9:58     ` Vincent Guittot
2023-10-26 11:19       ` Dietmar Eggemann
2023-10-26 14:30         ` Vincent Guittot

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=CAKfTPtBJRT56dL7+UW-viZuK3wKfGimQfrkvtuCQ_20g4N5LPQ@mail.gmail.com \
    --to=vincent.guittot@linaro.org \
    --cc=acpica-devel@lists.linuxfoundation.org \
    --cc=ajones@ventanamicro.com \
    --cc=aou@eecs.berkeley.edu \
    --cc=bristot@redhat.com \
    --cc=bsegall@google.com \
    --cc=catalin.marinas@arm.com \
    --cc=conor.dooley@microchip.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=ionela.voinescu@arm.com \
    --cc=juri.lelli@redhat.com \
    --cc=lenb@kernel.org \
    --cc=lftan@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=linux@armlinux.org.uk \
    --cc=lukasz.luba@arm.com \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    --cc=peterz@infradead.org \
    --cc=pierre.gondois@arm.com \
    --cc=robert.moore@intel.com \
    --cc=rostedt@goodmis.org \
    --cc=suagrfillet@gmail.com \
    --cc=sudeep.holla@arm.com \
    --cc=viresh.kumar@linaro.org \
    --cc=vschneid@redhat.com \
    --cc=will@kernel.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 read-only IMAP folder(s) and NNTP newsgroup(s).