Revert "powercap: intel_rapl: Expose all package CPUs in PMU cpumask"
Commit 525e0064f3d8 ("powercap: intel_rapl: Expose all package CPUs in
PMU cpumask") expanded cpumask to include all CPUs in the package.
Since perf opens an event for every CPU in cpumask, the value returned
for power/energy-pkg/ is roughly scaled by the number of CPUs.
On a single-socket 72-core DMR machine the reported value is roughly
72x higher than when perf is restricted to reading from a single CPU:
$ perf stat -e power/energy-pkg/ -- sleep 1
Performance counter stats for 'system wide':
8,052.48 Joules power/energy-pkg/
1.010483558 seconds time elapsed
$ perf stat -C 5 -e power/energy-pkg/ -- sleep 1
Performance counter stats for 'CPU(s) 5':
112.15 Joules power/energy-pkg/
1.009685587 seconds time elapsed
Reverting this commit restores the expected behavior for perf.
Fixes: 525e0064f3d8 ("powercap: intel_rapl: Expose all package CPUs in PMU cpumask")
Cc: All applicable <stable@vger.kernel.org>
Signed-off-by: Dennis Chen <dechen@redhat.com>
Link: https://patch.msgid.link/20261106203115.237269-1-dechen@redhat.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 file changed