Commit 6d108c96 authored by Thomas Gleixner's avatar Thomas Gleixner
Browse files

x86/aperfmperf: Dont wake idle CPUs in arch_freq_get_on_cpu()



aperfmperf_get_khz() already excludes idle CPUs from APERF/MPERF sampling
and that's a reasonable decision. There is no point in sending up to two
IPIs to an idle CPU just because someone reads a sysfs file.

Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Acked-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: default avatarPaul E. McKenney <paulmck@kernel.org>
Link: https://lore.kernel.org/r/20220415161206.419880163@linutronix.de
parent dbb5ab6d
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -139,6 +139,9 @@ unsigned int arch_freq_get_on_cpu(int cpu)
	if (!housekeeping_cpu(cpu, HK_TYPE_MISC))
		return 0;

	if (rcu_is_idle_cpu(cpu))
		return 0;

	if (aperfmperf_snapshot_cpu(cpu, ktime_get(), true))
		return per_cpu(samples.khz, cpu);