Re: [tip: sched/core] x86, sched: Add support for frequency invariance

From: Valentin Schneider
Date: Mon Mar 30 2020 - 12:03:18 EST



On Mon, Mar 30 2020, Peter Zijlstra wrote:
> +static void init_freq_invariance(bool secondary)
> {
> bool ret = false;
>
> - if (smp_processor_id() != 0 || !boot_cpu_has(X86_FEATURE_APERFMPERF))
> + if (!boot_cpu_has(X86_FEATURE_APERFMPERF))
> return;
>
> + if (secondary) {
> + if (static_branch_likely(&arch_scale_freq_key)) {
> + init_counter_refs(NULL);
> + }
> + return;
> + }
> +

Oh doh, that's an "enable once and for all" thing. That makes much more
sense; sorry for the noise.