[PATCH v6 00/10] Allow AET to use PMT as loadable module

Tony Luck posted 10 patches 1 month, 2 weeks ago
There is a newer version of this series
Documentation/filesystems/resctrl.rst      |  7 +-
include/linux/resctrl.h                    | 43 +++++++++++-
arch/x86/include/asm/resctrl.h             | 17 ++++-
arch/x86/kernel/cpu/resctrl/internal.h     | 19 +-----
arch/x86/kernel/cpu/resctrl/core.c         | 77 ++++++++++++++++++----
arch/x86/kernel/cpu/resctrl/intel_aet.c    | 67 ++++++++++++++++---
arch/x86/kernel/cpu/resctrl/monitor.c      | 11 +---
drivers/platform/x86/intel/pmt/telemetry.c | 17 ++++-
drivers/resctrl/mpam_resctrl.c             |  5 ++
fs/resctrl/monitor.c                       | 59 ++++++++++++-----
fs/resctrl/rdtgroup.c                      | 11 +++-
arch/x86/Kconfig                           | 16 +----
arch/x86/kernel/cpu/resctrl/Makefile       |  2 +-
13 files changed, 264 insertions(+), 87 deletions(-)
[PATCH v6 00/10] Allow AET to use PMT as loadable module
Posted by Tony Luck 1 month, 2 weeks ago
Requiring INTEL_PMT_TELEMETRY=y to enable AET is a functional workaround
to enable enumeration of Application Energy Telemetry (AET) events, but
unacceptable to many users. It results in increased configration complexity,
increased kernel memory footprint and inability to patch problems by unloading
a module and loading an updated version.

Add a registration function to the AET code that can be used by
INTEL_PMT_TELEMETRY to provide the enumeration functions.

INTEL_PMT_TELEMETRY can be loaded/unloaded independently of
resctrl file system mount/unmount. Perform enumeration on
every mount and cleanup on every unmount.

Signed-off-by: Tony Luck <tony.luck@intel.com>

---

Changes since v5:
Link: https://lore.kernel.org/all/20260410200532.58602-1-tony.luck@intel.com/

Moved locking around mount/unmount out of file system layer and into
x86 architecture code.

Fixed unmount cleanup to avoid empty mon_data directories if there is
no L3 monitoring and AET is enabled, then disabled on a subsequent
mount.

Fixed RMID allocation to cope with changed number of RMIDs from mount to
mount.

Added footnote to resctrl documentation warning user that AET may not be
enabled if the file system is mounted before enumeration completes.

Drop X86_CPU_RESCTRL_INTEL_AET from Kconfig.

FYI: Seems like no conflicts with Reinette's resctrl cleanup series:
Link: https://lore.kernel.org/all/cover.1777419024.git.reinette.chatre@intel.com/
This series applies cleanly on top of Reinette's patches, builds cleanly,
and passes resctrl selftests.

Tony Luck (10):
  x86/resctrl: Stop setting event_group::force_off on RMID shortage
  fs/resctrl: Add interface to disable a monitor event
  x86/resctrl: Maintain a count of enabled monitor features
  fs,x86,mpam/resctrl: Handle change in number of RMIDs on each mount
  x86/resctrl: x86/resctrl: Add PMT registration API for AET enumeration
    callbacks
  platform/x86/intel/pmt: Register enumeration functions with resctrl
  x86/resctrl: Resolve INTEL_PMT_TELEMETRY symbols at runtime
  fs/resctrl: Call architecture hooks for every mount/unmount
  x86/resctrl: Simplify Kconfig options for resctrl
  Documentation/filesystems/resctrl: Add footnote for telemetry fstab
    mount caveat

 Documentation/filesystems/resctrl.rst      |  7 +-
 include/linux/resctrl.h                    | 43 +++++++++++-
 arch/x86/include/asm/resctrl.h             | 17 ++++-
 arch/x86/kernel/cpu/resctrl/internal.h     | 19 +-----
 arch/x86/kernel/cpu/resctrl/core.c         | 77 ++++++++++++++++++----
 arch/x86/kernel/cpu/resctrl/intel_aet.c    | 67 ++++++++++++++++---
 arch/x86/kernel/cpu/resctrl/monitor.c      | 11 +---
 drivers/platform/x86/intel/pmt/telemetry.c | 17 ++++-
 drivers/resctrl/mpam_resctrl.c             |  5 ++
 fs/resctrl/monitor.c                       | 59 ++++++++++++-----
 fs/resctrl/rdtgroup.c                      | 11 +++-
 arch/x86/Kconfig                           | 16 +----
 arch/x86/kernel/cpu/resctrl/Makefile       |  2 +-
 13 files changed, 264 insertions(+), 87 deletions(-)


base-commit: 254f49634ee16a731174d2ae34bc50bd5f45e731
-- 
2.53.0