linux/tools/power
Gautham R. Shenoy e6601bb3cb pm: cpupower: Fix the snapshot-order of tsc,mperf, clock in mperf_stop()
[ Upstream commit cda7ac8ce7 ]

In the function mperf_start(), mperf_monitor snapshots the time, tsc
and finally the aperf,mperf MSRs. However, this order of snapshotting
in is reversed in mperf_stop(). As a result, the C0 residency (which
is computed as delta_mperf * 100 / delta_tsc) is under-reported on
CPUs that is 100% busy.

Fix this by snapshotting time, tsc and then aperf,mperf in
mperf_stop() in the same order as in mperf_start().

Link: https://lore.kernel.org/r/20250612122355.19629-2-gautham.shenoy@amd.com
Signed-off-by: Gautham R. Shenoy <gautham.shenoy@amd.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2025-08-20 18:30:27 +02:00
..
acpi ACPI: tools: pfrut: Print the update_cap field during capability query 2024-04-26 19:27:34 +02:00
cpupower pm: cpupower: Fix the snapshot-order of tsc,mperf, clock in mperf_stop() 2025-08-20 18:30:27 +02:00
pm-graph pm-graph: Update directory handling and installation process in Makefile 2024-09-04 14:34:54 +02:00
x86 tools/power turbostat: Fix AMD package-energy reporting 2025-06-19 15:32:21 +02:00