[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20240604122337.jknxekohcu23v7dz@airbuntu>
Date: Tue, 4 Jun 2024 13:23:37 +0100
From: Qais Yousef <qyousef@...alina.io>
To: Phil Auld <pauld@...hat.com>
Cc: linux-kernel@...r.kernel.org, Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
Dave Hansen <dave.hansen@...ux.intel.com>, x86@...nel.org,
Tony Luck <tony.luck@...el.com>
Subject: Re: [PATCH] sched,x86: export percpu arch_freq_scale
On 05/30/24 14:15, Phil Auld wrote:
> Commit 7bc263840bc3 ("sched/topology: Consolidate and clean up
> access to a CPU's max compute capacity") removed rq->cpu_capacity_orig
> in favor of using arch_scale_freq_capacity() calls. Export the
> underlying percpu symbol on x86 so that external trace point helper
> modules can be made to work again.
To expand. The problem here is that arch_scale_cpu/freq_capacity() are defined
in headers, but they rely on per cpu variables that are not exported for x86,
but are exported for arm (and riscv at least) in drivers/base/arch_topology.c
One user is sched_tp to help create trace events to track when capacity
changes. Not critical user, but this brings x86 inline with the rest of the
code.
>
> Signed-off-by: Phil Auld <pauld@...hat.com>
> Cc: Thomas Gleixner <tglx@...utronix.de>
> Cc: Ingo Molnar <mingo@...hat.com>
> Cc: Borislav Petkov <bp@...en8.de>
> Cc: Dave Hansen <dave.hansen@...ux.intel.com>
> Cc: x86@...nel.org
> Cc: Tony Luck <tony.luck@...el.com>
> Cc: Qais Yousef <qyousef@...alina.io>
> ---
> arch/x86/kernel/cpu/aperfmperf.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/arch/x86/kernel/cpu/aperfmperf.c b/arch/x86/kernel/cpu/aperfmperf.c
> index f9a8c7b7943f..b3fa61d45352 100644
> --- a/arch/x86/kernel/cpu/aperfmperf.c
> +++ b/arch/x86/kernel/cpu/aperfmperf.c
> @@ -345,6 +345,7 @@ static DECLARE_WORK(disable_freq_invariance_work,
> disable_freq_invariance_workfn);
>
> DEFINE_PER_CPU(unsigned long, arch_freq_scale) = SCHED_CAPACITY_SCALE;
> +EXPORT_PER_CPU_SYMBOL_GPL(arch_freq_scale);
x86 uses the generic arch_scale_cpu_capacity() in sched/topology.h, so this
should make arch_scale_freq_capacity() 'work' for x86 too.
Reviewed-by: Qais Yousef <qyousef@...alina.io>
>
> static void scale_freq_tick(u64 acnt, u64 mcnt)
> {
> --
> 2.43.0
>
Powered by blists - more mailing lists