]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
x86,fs/resctrl: Compute number of RMIDs as minimum across resources
authorTony Luck <tony.luck@intel.com>
Wed, 17 Dec 2025 17:21:14 +0000 (09:21 -0800)
committerBorislav Petkov (AMD) <bp@alien8.de>
Sat, 10 Jan 2026 10:43:58 +0000 (11:43 +0100)
commit0ecc988b0232259cbdb2b7e452bda74f550f0911
tree3368ec8d777396272d22db4b74ab8a67d6749ba0
parentee7f6af79f0916b6c49e15edd4cba020b3e4c4ac
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
arch/x86/kernel/cpu/resctrl/core.c
fs/resctrl/rdtgroup.c