summaryrefslogtreecommitdiff
path: root/fs/resctrl
diff options
context:
space:
mode:
authorTony Luck <tony.luck@intel.com>2025-12-17 09:21:14 -0800
committerBorislav Petkov (AMD) <bp@alien8.de>2026-01-10 11:43:58 +0100
commit0ecc988b0232259cbdb2b7e452bda74f550f0911 (patch)
tree3368ec8d777396272d22db4b74ab8a67d6749ba0 /fs/resctrl
parentee7f6af79f0916b6c49e15edd4cba020b3e4c4ac (diff)
x86,fs/resctrl: Compute number of RMIDs as minimum across resources
resctrl assumes that only the L3 resource supports monitor events, so it simply takes the rdt_resource::num_rmid from RDT_RESOURCE_L3 as the system's number of RMIDs. The addition of telemetry events in a different resource breaks that assumption. Compute the number of available RMIDs as the minimum value across all mon_capable resources (analogous to how the number of CLOSIDs is computed across alloc_capable resources). Note that mount time enumeration of the telemetry resource means that this number can be reduced. If this happens, then some memory will be wasted as the allocations for rdt_l3_mon_domain::mbm_states[] and rdt_l3_mon_domain::rmid_busy_llc created during resctrl initialization will be larger than needed. Signed-off-by: Tony Luck <tony.luck@intel.com> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Reviewed-by: Reinette Chatre <reinette.chatre@intel.com> Link: https://lore.kernel.org/20251217172121.12030-1-tony.luck@intel.com
Diffstat (limited to 'fs/resctrl')
-rw-r--r--fs/resctrl/rdtgroup.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/resctrl/rdtgroup.c b/fs/resctrl/rdtgroup.c
index 90c4a199a288..666cac7661ce 100644
--- a/fs/resctrl/rdtgroup.c
+++ b/fs/resctrl/rdtgroup.c
@@ -4353,6 +4353,12 @@ out_unlock:
* During boot this may be called before global allocations have been made by
* resctrl_l3_mon_resource_init().
*
+ * Called during CPU online that may run as soon as CPU online callbacks
+ * are set up during resctrl initialization. The number of supported RMIDs
+ * may be reduced if additional mon_capable resources are enumerated
+ * at mount time. This means the rdt_l3_mon_domain::mbm_states[] and
+ * rdt_l3_mon_domain::rmid_busy_llc allocations may be larger than needed.
+ *
* Return: 0 for success, or -ENOMEM.
*/
static int domain_setup_l3_mon_state(struct rdt_resource *r, struct rdt_l3_mon_domain *d)