Re: [PATCH v2 3/7] arch_topology: disable frequency invariance for CONFIG_BL_SWITCHER

From: Ionela Voinescu
Date: Mon Aug 10 2020 - 05:01:07 EST


Hi guys,

On Tuesday 04 Aug 2020 at 12:00:46 (+0530), Viresh Kumar wrote:
> On 30-07-20, 12:29, Dietmar Eggemann wrote:
> > On 30/07/2020 06:24, Viresh Kumar wrote:
> > > On 22-07-20, 10:37, Ionela Voinescu wrote:
> > >> +++ b/drivers/base/arch_topology.c
> > >> @@ -27,6 +27,7 @@ __weak bool arch_freq_counters_available(struct cpumask *cpus)
> > >> }
> > >> DEFINE_PER_CPU(unsigned long, freq_scale) = SCHED_CAPACITY_SCALE;
> > >>
> > >> +#ifndef CONFIG_BL_SWITCHER
> > >> void arch_set_freq_scale(struct cpumask *cpus, unsigned long cur_freq,
> > >> unsigned long max_freq)
> > >> {
> > >> @@ -46,6 +47,7 @@ void arch_set_freq_scale(struct cpumask *cpus, unsigned long cur_freq,
> > >> for_each_cpu(i, cpus)
> > >> per_cpu(freq_scale, i) = scale;
> > >> }
> > >> +#endif
> > >
> > > I don't really like this change, the ifdef hackery is disgusting and
> > > then we are putting that in a completely different part of the kernel.
> > >
> > > There are at least these two ways of solving this, maybe more:
> > >
> > > - Fix the bl switcher driver and add the complexity in it (which you
> > > tried to do earlier).
> > >
> > > - Add a cpufreq flag to skip arch-set-freq-scale call.
> >
> > I agree it's not nice but IMHO the cpufreq flag is worse since we would
> > introduce new infrastructure only for a deprecated feature. I'm assuming
> > that BL SWITCHER is the only feature needing this CPUfreq flag extension.
> >
> > #ifdef CONFIG_BL_SWITCHER is already in drivers/irqchip/irq-gic.c so
> > it's ugly already.
> >
> > Runtime detecting (via bL_switching_enabled) of BL SWITCHER is right now
> > also only handled inside vexpress-spc-cpufreq.c via a
> > bL_switcher_notifier. A mechanism which also sits behind a #ifdef
> > CONFIG_BL_SWITCHER.
>
> Vexpress one is a driver and so ugliness could be ignored here :)
>
> So here is option number 3 (in continuation of the earlier two
> options):
> - Don't do anything for bL switcher, just add a TODO/NOTE in the
> driver that FIE is broken for switcher. And I don't think anyone
> will care about FIE for the switcher anyway :)
>

I gave it a bit of time in case anyone had strong opinions about this,
but given the lack of those, what I can do in this series is the
following: ignore the problem :). This issue was there before these
patches and it will continue to be there after these patches - nothing
changes.

Separately from this series, I can submit a patch with Viresh's
suggestion above and we can spin around a bit discussing this, if there
is interest. My opinion on this is that option 1 is ugly but it does fix
an issue in a relatively non-invasive way. I agree with "I don't think
anyone will care about FIE for the switcher anyway", but for me this
means that nobody will care if it's supported (and therefore option 1
is the proper solution). But if bL switcher is used, I think people might
care if it's broken, as it results in incorrect scheduler signals.
Therefore, I would not like leaving it broken (option 3). If it's not
used, option 2 is obvious.


Many thanks,
Ionela.

> --
> viresh