[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210217042558.o4anjdkayzgqny55@vireshk-i7>
Date: Wed, 17 Feb 2021 09:55:58 +0530
From: Viresh Kumar <viresh.kumar@...aro.org>
To: Ionela Voinescu <ionela.voinescu@....com>
Cc: Rafael Wysocki <rjw@...ysocki.net>,
Catalin Marinas <catalin.marinas@....com>,
Will Deacon <will@...nel.org>,
Vincent Guittot <vincent.guittot@...aro.org>,
linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-pm@...r.kernel.org, Sudeep Holla <sudeep.holla@....com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Subject: Re: [PATCH V3 1/2] topology: Allow multiple entities to provide
sched_freq_tick() callback
On 17-02-21, 00:24, Ionela Voinescu wrote:
> I think it could be merged in patch 1/2 as it's part of enabling the use
> of multiple sources of information for FIE. Up to you!
Sure.
> > static void amu_fie_setup(const struct cpumask *cpus)
> > {
> > - bool invariant;
> > int cpu;
> >
> > /* We are already set since the last insmod of cpufreq driver */
> > @@ -257,25 +256,10 @@ static void amu_fie_setup(const struct cpumask *cpus)
> >
> > cpumask_or(amu_fie_cpus, amu_fie_cpus, cpus);
> >
> > - invariant = topology_scale_freq_invariant();
> > -
> > - /* We aren't fully invariant yet */
> > - if (!invariant && !cpumask_equal(amu_fie_cpus, cpu_present_mask))
> > - return;
> > -
>
> You still need these checks, otherwise you could end up with only part
> of the CPUs setting a scale factor, when only part of the CPUs support
> AMUs and there is no cpufreq support for FIE.
Both supports_scale_freq_counters() and topology_scale_freq_invariant() take
care of this now and they will keep reporting the system as invariant until the
time all the CPUs have counters (in absence of cpufreq).
The topology_set_scale_freq_source() API is supposed to be called multiple
times, probably once for each policy and so I don't see a need of these checks
anymore.
> Small(ish) optimisation at the beginning of this function:
>
> if (cpumask_empty(&scale_freq_counters_mask))
> scale_freq_invariant = topology_scale_freq_invariant();
>
> This will save you a call to rebuild_sched_domains_energy(), which is
> quite expensive, when cpufreq supports FIE and we also have counters.
Good Point.
> After comments addressed,
>
> Reviewed-by: Ionela Voinescu <ionela.voinescu@....com>
Thanks.
> Tested-by: Ionela Voinescu <ionela.voinescu@....com>
Just out of curiosity, what exactly did you test and what was the setup ? :)
--
viresh
Powered by blists - more mailing lists