[PATCH v12 20/25] x86/resctrl: Enforce system RMID limit on AET
From: Tony Luck
Date: Wed Sep 16 2026 - 19:23:00 EST
AET (Application Energy Telemetry) event groups each support a specific
number of RMIDs. But that number may be lower than the number supported
by the system. This is especially true on systems with SNC (Sub-NUMA Cluster)
enabled as that reduces the number of supported RMIDs.
Reduce r->mon.num_rmid if needed to ensure that info/PERF_PKG_MON/num_rmids
does not display an unachievable value to users.
Signed-off-by: Tony Luck <tony.luck@xxxxxxxxx>
---
v12:
Replacement for v11 patch 14 "Enforce system RMID limit ..."
---
arch/x86/kernel/cpu/resctrl/core.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/arch/x86/kernel/cpu/resctrl/core.c b/arch/x86/kernel/cpu/resctrl/core.c
index 3bf4d1a07593..a20439a5099a 100644
--- a/arch/x86/kernel/cpu/resctrl/core.c
+++ b/arch/x86/kernel/cpu/resctrl/core.c
@@ -798,6 +798,12 @@ void resctrl_arch_pre_mount(void)
if (!intel_aet_pre_mount())
return;
+ /*
+ * AET may claim to support more RMIDs than are permitted to be
+ * assigned to IA32_PQR_ASSOC.RMID. Enforce this limit.
+ */
+ r->mon.num_rmid = min(r->mon.num_rmid, pqr_assoc_num_rmid);
+
/*
* Late discovery of telemetry events means the domains for the
* resource were not built. Do that now.
--
2.55.0