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: <20201110094956.GZ2594@hirez.programming.kicks-ass.net>
Date:   Tue, 10 Nov 2020 10:49:56 +0100
From:   Peter Zijlstra <peterz@...radead.org>
To:     Giovanni Gherdovich <ggherdovich@...e.cz>
Cc:     Borislav Petkov <bp@...en8.de>,
        Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>, Len Brown <lenb@...nel.org>,
        "Rafael J . Wysocki" <rjw@...ysocki.net>,
        Jon Grimm <Jon.Grimm@....com>,
        Nathan Fontenot <Nathan.Fontenot@....com>,
        Yazen Ghannam <Yazen.Ghannam@....com>,
        Thomas Lendacky <Thomas.Lendacky@....com>,
        Mel Gorman <mgorman@...hsingularity.net>,
        Pu Wen <puwen@...on.cn>,
        Viresh Kumar <viresh.kumar@...aro.org>,
        Juri Lelli <juri.lelli@...hat.com>,
        Vincent Guittot <vincent.guittot@...aro.org>,
        Dietmar Eggemann <dietmar.eggemann@....com>,
        Doug Smythies <dsmythies@...us.net>, x86@...nel.org,
        linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-acpi@...r.kernel.org
Subject: Re: [PATCH 1/3] x86, sched: Calculate frequency invariance for AMD
 systems

On Tue, Nov 10, 2020 at 09:39:34AM +0100, Giovanni Gherdovich wrote:

> +#ifdef CONFIG_ACPI
> +void init_freq_invariance_cppc(void)
> +{
> +	init_freq_invariance(false, true);
> +
> +	if (static_branch_likely(&arch_scale_freq_key))
> +		on_each_cpu(init_counter_refs, NULL, 0);
> +}
> +#endif
> +
>  static void disable_freq_invariance_workfn(struct work_struct *work)
>  {
>  	static_branch_disable(&arch_scale_freq_key);

> diff --git a/drivers/acpi/cppc_acpi.c b/drivers/acpi/cppc_acpi.c
> index 7a99b19bb893..e1969ff876ff 100644
> --- a/drivers/acpi/cppc_acpi.c
> +++ b/drivers/acpi/cppc_acpi.c
> @@ -39,6 +39,7 @@
>  #include <linux/ktime.h>
>  #include <linux/rwsem.h>
>  #include <linux/wait.h>
> +#include <linux/topology.h>
>  
>  #include <acpi/cppc_acpi.h>
>  
> @@ -850,6 +851,10 @@ int acpi_cppc_processor_probe(struct acpi_processor *pr)
>  		goto out_free;
>  	}
>  
> +	/* Only needed once, so call on CPU0 */
> +	if (pr->id == 0)
> +		init_freq_invariance_cppc();
> +

This seems broken vs lovely things like booting with maxcpus= or
physical hotplug where you add logical CPUs.

Given the latter hunk limits it to one invocation (is phys_id 0
guaranteed to exist? Can a BIOS monkey screw us over?) only to then call
it on all CPUs, shouldn't this be changed to let
acpi_cppc_processor_probe() call it for every CPU that comes online?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ