linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/5] perf/x86/uncore: Overflow handling enhancements
@ 2025-04-18  3:42 Sandipan Das
  2025-04-18  3:42 ` [PATCH v2 1/5] perf/x86/amd/uncore: Remove unused member from amd_uncore_ctx Sandipan Das
                   ` (5 more replies)
  0 siblings, 6 replies; 10+ messages in thread
From: Sandipan Das @ 2025-04-18  3:42 UTC (permalink / raw)
  To: linux-perf-users, linux-kernel
  Cc: peterz, mingo, acme, namhyung, mark.rutland, alexander.shishkin,
	jolsa, irogers, adrian.hunter, kan.liang, tglx, bp, dave.hansen,
	x86, hpa, eranian, songliubraving, ravi.bangoria, ananth.narayan,
	sandipan.das

Uncore counters on AMD processors either roll over or saturate on
overflow and the amd-uncore driver has no way of knowing if multiple
overflows have occurred between two successive pmu->read() requests for
an event. This makes the user-visible counter values inaccurate. Solve
this by periodically initiating pmu->read() in order to keep prev_count
up-to-date. The approach follows Intel's precedent in handling uncore
counters.

Previous versions can be found at:
v1: https://lore.kernel.org/all/cover.1744184837.git.sandipan.das@amd.com/

Changes in v2:
 - Add a Fixes tag for the first patch.
 - Change the hrtimer mode for both the Intel and the AMD uncore drivers
   based on Peter's suggestion.
 - Fix an issue in the UMC workaround where prev_count is not zeroed out
   after a counter is reset.

Sandipan Das (5):
  perf/x86/amd/uncore: Remove unused member from amd_uncore_ctx
  perf/x86/intel/uncore: Use HRTIMER_MODE_HARD for detecting overflows
  perf/x86/amd/uncore: Use hrtimer for handling overflows
  perf/x86/amd/uncore: Add parameter to configure hrtimer
  perf/x86/amd/uncore: Prevent UMC counters from saturating

 arch/x86/events/amd/uncore.c   | 103 ++++++++++++++++++++++++++++++++-
 arch/x86/events/intel/uncore.c |  12 +---
 2 files changed, 103 insertions(+), 12 deletions(-)

-- 
2.43.0


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

end of thread, other threads:[~2025-04-18  9:28 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-18  3:42 [PATCH v2 0/5] perf/x86/uncore: Overflow handling enhancements Sandipan Das
2025-04-18  3:42 ` [PATCH v2 1/5] perf/x86/amd/uncore: Remove unused member from amd_uncore_ctx Sandipan Das
2025-04-18  3:43 ` [PATCH v2 2/5] perf/x86/intel/uncore: Use HRTIMER_MODE_HARD for detecting overflows Sandipan Das
2025-04-18  3:43 ` [PATCH v2 3/5] perf/x86/amd/uncore: Use hrtimer for handling overflows Sandipan Das
2025-04-18  4:38   ` Stephane Eranian
2025-04-18  4:49     ` Sandipan Das
2025-04-18  3:43 ` [PATCH v2 4/5] perf/x86/amd/uncore: Add parameter to configure hrtimer Sandipan Das
2025-04-18  3:43 ` [PATCH v2 5/5] perf/x86/amd/uncore: Prevent UMC counters from saturating Sandipan Das
2025-04-18  8:32 ` [PATCH v2 0/5] perf/x86/uncore: Overflow handling enhancements Ingo Molnar
2025-04-18  9:27   ` Sandipan Das

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).