[PATCH 0/7] perf/x86/intel/uncore: PMU setup robustness fixes

Zide Chen posted 7 patches 1 month ago
There is a newer version of this series
arch/x86/events/intel/uncore.c           | 214 +++++++++++------------
arch/x86/events/intel/uncore.h           |  36 ++--
arch/x86/events/intel/uncore_discovery.c |  16 +-
arch/x86/events/intel/uncore_discovery.h |   6 +-
arch/x86/events/intel/uncore_nhmex.c     |   3 +-
arch/x86/events/intel/uncore_snb.c       |  84 +++++----
arch/x86/events/intel/uncore_snbep.c     |  71 +++++---
7 files changed, 242 insertions(+), 188 deletions(-)
[PATCH 0/7] perf/x86/intel/uncore: PMU setup robustness fixes
Posted by Zide Chen 1 month ago
This series fixes correctness issues in Intel uncore PMU setup:

- If all init_box() on a PMU fails, the PMU sysfs node may still exist,
  while perf events read zeros and silently report wrong data.
- If init_box() fails on only some dies, perf may return partial
  non-zero counts, which is harder to diagnose.
- CPU hotplug ref/unref ordering bugs can skip init_box() when the first
  CPU in a die comes online, and can call box_exit() prematurely when
  the second-to-last CPU goes offline.

To address this, the series introduces a PMU broken state to track setup
failures and switches MSR/MMIO PMUs to lazy registration, matching
existing PCI behavior.

Zide Chen (7):
  perf/x86/intel/uncore: Rename refcount fields and other cleanups
  perf/x86/intel/uncore: Let init_box() callback report failures
  perf/x86/intel/uncore: Keep PCI PMUs working when MMIO/MSR setup fails
  perf/x86/intel/uncore: Factor out box setup code
  perf/x86/intel/uncore: Introduce PMU flags and broken state
  perf/x86/intel/uncore: Fix uncore_box ref/unref ordering on CPU
    hotplug
  perf/x86/intel/uncore: Implement lazy setup for MSR/MMIO PMU

 arch/x86/events/intel/uncore.c           | 214 +++++++++++------------
 arch/x86/events/intel/uncore.h           |  36 ++--
 arch/x86/events/intel/uncore_discovery.c |  16 +-
 arch/x86/events/intel/uncore_discovery.h |   6 +-
 arch/x86/events/intel/uncore_nhmex.c     |   3 +-
 arch/x86/events/intel/uncore_snb.c       |  84 +++++----
 arch/x86/events/intel/uncore_snbep.c     |  71 +++++---
 7 files changed, 242 insertions(+), 188 deletions(-)

-- 
2.54.0