mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] sched,x86: export percpu arch_freq_scale
@ 2024-05-30 18:15 Phil Auld
  2024-05-31  9:59 ` [tip: sched/urgent] sched/x86: Export 'percpu arch_freq_scale' tip-bot2 for Phil Auld
  2024-06-04 12:23 ` [PATCH] sched,x86: export percpu arch_freq_scale Qais Yousef
  0 siblings, 2 replies; 4+ messages in thread
From: Phil Auld @ 2024-05-30 18:15 UTC (permalink / raw)
  To: linux-kernel
  Cc: Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen, x86,
	Tony Luck, Qais Yousef

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.

Signed-off-by: Phil Auld <pauld@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: x86@kernel.org
Cc: Tony Luck <tony.luck@intel.com>
Cc: Qais Yousef <qyousef@layalina.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);
 
 static void scale_freq_tick(u64 acnt, u64 mcnt)
 {
-- 
2.43.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [tip: sched/urgent] sched/x86: Export 'percpu arch_freq_scale'
  2024-05-30 18:15 [PATCH] sched,x86: export percpu arch_freq_scale Phil Auld
@ 2024-05-31  9:59 ` tip-bot2 for Phil Auld
  2024-05-31 13:19   ` Phil Auld
  2024-06-04 12:23 ` [PATCH] sched,x86: export percpu arch_freq_scale Qais Yousef
  1 sibling, 1 reply; 4+ messages in thread
From: tip-bot2 for Phil Auld @ 2024-05-31  9:59 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Phil Auld, Ingo Molnar, Peter Zijlstra, x86, linux-kernel

The following commit has been merged into the sched/urgent branch of tip:

Commit-ID:     d40605a6823577a6c40fad6fb1f10a40ea0389d7
Gitweb:        https://git.kernel.org/tip/d40605a6823577a6c40fad6fb1f10a40ea0389d7
Author:        Phil Auld <pauld@redhat.com>
AuthorDate:    Thu, 30 May 2024 14:15:48 -04:00
Committer:     Ingo Molnar <mingo@kernel.org>
CommitterDate: Fri, 31 May 2024 11:48:42 +02:00

sched/x86: Export 'percpu arch_freq_scale'

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.

Signed-off-by: Phil Auld <pauld@redhat.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/r/20240530181548.2039216-1-pauld@redhat.com
---
 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 f9a8c7b..b3fa61d 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);
 
 static void scale_freq_tick(u64 acnt, u64 mcnt)
 {

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [tip: sched/urgent] sched/x86: Export 'percpu arch_freq_scale'
  2024-05-31  9:59 ` [tip: sched/urgent] sched/x86: Export 'percpu arch_freq_scale' tip-bot2 for Phil Auld
@ 2024-05-31 13:19   ` Phil Auld
  0 siblings, 0 replies; 4+ messages in thread
From: Phil Auld @ 2024-05-31 13:19 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: Peter Zijlstra, x86, linux-kernel

On Fri, May 31, 2024 at 09:59:45AM -0000 tip-bot2 for Phil Auld wrote:
> The following commit has been merged into the sched/urgent branch of tip:
> 
> Commit-ID:     d40605a6823577a6c40fad6fb1f10a40ea0389d7
> Gitweb:        https://git.kernel.org/tip/d40605a6823577a6c40fad6fb1f10a40ea0389d7
> Author:        Phil Auld <pauld@redhat.com>
> AuthorDate:    Thu, 30 May 2024 14:15:48 -04:00
> Committer:     Ingo Molnar <mingo@kernel.org>
> CommitterDate: Fri, 31 May 2024 11:48:42 +02:00
> 
> sched/x86: Export 'percpu arch_freq_scale'
>

Thanks Ingo!


> 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.
> 
> Signed-off-by: Phil Auld <pauld@redhat.com>
> Signed-off-by: Ingo Molnar <mingo@kernel.org>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Link: https://lore.kernel.org/r/20240530181548.2039216-1-pauld@redhat.com
> ---
>  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 f9a8c7b..b3fa61d 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);
>  
>  static void scale_freq_tick(u64 acnt, u64 mcnt)
>  {
> 

-- 


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] sched,x86: export percpu arch_freq_scale
  2024-05-30 18:15 [PATCH] sched,x86: export percpu arch_freq_scale Phil Auld
  2024-05-31  9:59 ` [tip: sched/urgent] sched/x86: Export 'percpu arch_freq_scale' tip-bot2 for Phil Auld
@ 2024-06-04 12:23 ` Qais Yousef
  1 sibling, 0 replies; 4+ messages in thread
From: Qais Yousef @ 2024-06-04 12:23 UTC (permalink / raw)
  To: Phil Auld
  Cc: linux-kernel, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
	Dave Hansen, x86, Tony Luck

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@redhat.com>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Ingo Molnar <mingo@redhat.com>
> Cc: Borislav Petkov <bp@alien8.de>
> Cc: Dave Hansen <dave.hansen@linux.intel.com>
> Cc: x86@kernel.org
> Cc: Tony Luck <tony.luck@intel.com>
> Cc: Qais Yousef <qyousef@layalina.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@layalina.io>

>  
>  static void scale_freq_tick(u64 acnt, u64 mcnt)
>  {
> -- 
> 2.43.0
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-06-04 12:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-30 18:15 [PATCH] sched,x86: export percpu arch_freq_scale Phil Auld
2024-05-31  9:59 ` [tip: sched/urgent] sched/x86: Export 'percpu arch_freq_scale' tip-bot2 for Phil Auld
2024-05-31 13:19   ` Phil Auld
2024-06-04 12:23 ` [PATCH] sched,x86: export percpu arch_freq_scale Qais Yousef

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®