linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1] x86/sched: Print debug messages on hybrid asym capacity changes
@ 2025-07-09 10:47 Rafael J. Wysocki
  2025-07-09 11:46 ` Peter Zijlstra
  0 siblings, 1 reply; 3+ messages in thread
From: Rafael J. Wysocki @ 2025-07-09 10:47 UTC (permalink / raw)
  To: x86 Maintainers; +Cc: LKML, Linux PM, Ricardo Neri, Peter Zijlstra

From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Subject: [PATCH v1] x86/sched: Print debug messages on hybrid asym capacity changes

Make arch_set_cpu_capacity() print a debug message including the
capacity and maximum frequency ratio used in scale-invariant utilization
computations for a given CPU and in capacity-aware scheduling (CAS) or
energy-aware scheduling (EAS).

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
 arch/x86/kernel/cpu/aperfmperf.c |    4 ++++
 1 file changed, 4 insertions(+)

--- a/arch/x86/kernel/cpu/aperfmperf.c
+++ b/arch/x86/kernel/cpu/aperfmperf.c
@@ -416,6 +416,10 @@
 			   div_u64(cap << SCHED_CAPACITY_SHIFT, max_cap));
 		WRITE_ONCE(per_cpu_ptr(arch_cpu_scale, cpu)->freq_ratio,
 			   div_u64(cap_freq << SCHED_CAPACITY_SHIFT, base_freq));
+
+		pr_debug("CPU%d: capacity = %lu, freq_ratio = %lu\n", cpu,
+			 per_cpu_ptr(arch_cpu_scale, cpu)->capacity,
+			 per_cpu_ptr(arch_cpu_scale, cpu)->freq_ratio);
 	} else {
 		WARN_ONCE(1, "Hybrid CPU capacity scaling not enabled");
 	}




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

* Re: [PATCH v1] x86/sched: Print debug messages on hybrid asym capacity changes
  2025-07-09 10:47 [PATCH v1] x86/sched: Print debug messages on hybrid asym capacity changes Rafael J. Wysocki
@ 2025-07-09 11:46 ` Peter Zijlstra
  2025-07-09 12:02   ` Rafael J. Wysocki
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Zijlstra @ 2025-07-09 11:46 UTC (permalink / raw)
  To: Rafael J. Wysocki; +Cc: x86 Maintainers, LKML, Linux PM, Ricardo Neri

On Wed, Jul 09, 2025 at 12:47:17PM +0200, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> Subject: [PATCH v1] x86/sched: Print debug messages on hybrid asym capacity changes
> 
> Make arch_set_cpu_capacity() print a debug message including the
> capacity and maximum frequency ratio used in scale-invariant utilization
> computations for a given CPU and in capacity-aware scheduling (CAS) or
> energy-aware scheduling (EAS).
> 
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> ---
>  arch/x86/kernel/cpu/aperfmperf.c |    4 ++++
>  1 file changed, 4 insertions(+)
> 
> --- a/arch/x86/kernel/cpu/aperfmperf.c
> +++ b/arch/x86/kernel/cpu/aperfmperf.c
> @@ -416,6 +416,10 @@
>  			   div_u64(cap << SCHED_CAPACITY_SHIFT, max_cap));
>  		WRITE_ONCE(per_cpu_ptr(arch_cpu_scale, cpu)->freq_ratio,
>  			   div_u64(cap_freq << SCHED_CAPACITY_SHIFT, base_freq));
> +
> +		pr_debug("CPU%d: capacity = %lu, freq_ratio = %lu\n", cpu,
> +			 per_cpu_ptr(arch_cpu_scale, cpu)->capacity,
> +			 per_cpu_ptr(arch_cpu_scale, cpu)->freq_ratio);
>  	} else {
>  		WARN_ONCE(1, "Hybrid CPU capacity scaling not enabled");
>  	}

There's already a printk in the calling function
hybrid_set_cpu_capacity(), so now we get _2_ prints per CPU. That's a
bit excessive, no?

Also, should this print be conditional on sched_debug_verbose?

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

* Re: [PATCH v1] x86/sched: Print debug messages on hybrid asym capacity changes
  2025-07-09 11:46 ` Peter Zijlstra
@ 2025-07-09 12:02   ` Rafael J. Wysocki
  0 siblings, 0 replies; 3+ messages in thread
From: Rafael J. Wysocki @ 2025-07-09 12:02 UTC (permalink / raw)
  To: Peter Zijlstra
  Cc: Rafael J. Wysocki, x86 Maintainers, LKML, Linux PM, Ricardo Neri

On Wed, Jul 9, 2025 at 1:46 PM Peter Zijlstra <peterz@infradead.org> wrote:
>
> On Wed, Jul 09, 2025 at 12:47:17PM +0200, Rafael J. Wysocki wrote:
> > From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> > Subject: [PATCH v1] x86/sched: Print debug messages on hybrid asym capacity changes
> >
> > Make arch_set_cpu_capacity() print a debug message including the
> > capacity and maximum frequency ratio used in scale-invariant utilization
> > computations for a given CPU and in capacity-aware scheduling (CAS) or
> > energy-aware scheduling (EAS).
> >
> > Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> > ---
> >  arch/x86/kernel/cpu/aperfmperf.c |    4 ++++
> >  1 file changed, 4 insertions(+)
> >
> > --- a/arch/x86/kernel/cpu/aperfmperf.c
> > +++ b/arch/x86/kernel/cpu/aperfmperf.c
> > @@ -416,6 +416,10 @@
> >                          div_u64(cap << SCHED_CAPACITY_SHIFT, max_cap));
> >               WRITE_ONCE(per_cpu_ptr(arch_cpu_scale, cpu)->freq_ratio,
> >                          div_u64(cap_freq << SCHED_CAPACITY_SHIFT, base_freq));
> > +
> > +             pr_debug("CPU%d: capacity = %lu, freq_ratio = %lu\n", cpu,
> > +                      per_cpu_ptr(arch_cpu_scale, cpu)->capacity,
> > +                      per_cpu_ptr(arch_cpu_scale, cpu)->freq_ratio);
> >       } else {
> >               WARN_ONCE(1, "Hybrid CPU capacity scaling not enabled");
> >       }
>
> There's already a printk in the calling function
> hybrid_set_cpu_capacity(), so now we get _2_ prints per CPU. That's a
> bit excessive, no?

Yeah, fair enough.

> Also, should this print be conditional on sched_debug_verbose?

It might, but it is dynamic debug anyway.

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

end of thread, other threads:[~2025-07-09 12:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-09 10:47 [PATCH v1] x86/sched: Print debug messages on hybrid asym capacity changes Rafael J. Wysocki
2025-07-09 11:46 ` Peter Zijlstra
2025-07-09 12:02   ` Rafael J. Wysocki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).