lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1db4317a-0018-1590-f0ae-ed5e235b174f@arm.com>
Date:   Thu, 30 Jul 2020 12:29:52 +0200
From:   Dietmar Eggemann <dietmar.eggemann@....com>
To:     Viresh Kumar <viresh.kumar@...aro.org>,
        Ionela Voinescu <ionela.voinescu@....com>
Cc:     rjw@...ysocki.net, catalin.marinas@....com, sudeep.holla@....com,
        will@...nel.org, linux@...linux.org.uk, mingo@...hat.com,
        peterz@...radead.org, linux-pm@...r.kernel.org,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 3/7] arch_topology: disable frequency invariance for
 CONFIG_BL_SWITCHER

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.


So IMHO, the additional #ifdef CONFIG_BL_SWITCHER in
drivers/base/arch_topology.c it's a small price to pay.

Are there still any users of CONFIG_BL_SWITCHER? I guess it's only
limited to A15/A7 systems w/ vexpress-spc-cpufreq.c ... so probably only
TC2?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ