]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
x86,fs/resctrl: Remove inappropriate references to cacheinfo in the resctrl subsystem
authorQinyun Tan <qinyuntan@linux.alibaba.com>
Fri, 30 May 2025 18:20:53 +0000 (02:20 +0800)
committerBorislav Petkov (AMD) <bp@alien8.de>
Mon, 16 Jun 2025 19:06:12 +0000 (21:06 +0200)
commit594902c986e269660302f09df9ec4bf1cf017b77
tree6e866243b0afb55dc099c00d6b464144e6373412
parent9afe652958c3ee88f24df1e4a97f298afce89407
x86,fs/resctrl: Remove inappropriate references to cacheinfo in the resctrl subsystem

In the resctrl subsystem's Sub-NUMA Cluster (SNC) mode, the rdt_mon_domain
structure representing a NUMA node relies on the cacheinfo interface
(rdt_mon_domain::ci) to store L3 cache information (e.g., shared_cpu_map)
for monitoring. The L3 cache information of a SNC NUMA node determines
which domains are summed for the "top level" L3-scoped events.

rdt_mon_domain::ci is initialized using the first online CPU of a NUMA
node. When this CPU goes offline, its shared_cpu_map is cleared to contain
only the offline CPU itself. Subsequently, attempting to read counters
via smp_call_on_cpu(offline_cpu) fails (and error ignored), returning
zero values for "top-level events" without any error indication.

Replace the cacheinfo references in struct rdt_mon_domain and struct
rmid_read with the cacheinfo ID (a unique identifier for the L3 cache).

rdt_domain_hdr::cpu_mask contains the online CPUs associated with that
domain. When reading "top-level events", select a CPU from
rdt_domain_hdr::cpu_mask and utilize its L3 shared_cpu_map to determine
valid CPUs for reading RMID counter via the MSR interface.

Considering all CPUs associated with the L3 cache improves the chances
of picking a housekeeping CPU on which the counter reading work can be
queued, avoiding an unnecessary IPI.

Fixes: 328ea68874642 ("x86/resctrl: Prepare for new Sub-NUMA Cluster (SNC) monitor files")
Signed-off-by: Qinyun Tan <qinyuntan@linux.alibaba.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Reviewed-by: Reinette Chatre <reinette.chatre@intel.com>
Tested-by: Tony Luck <tony.luck@intel.com>
Link: https://lore.kernel.org/20250530182053.37502-2-qinyuntan@linux.alibaba.com
arch/x86/kernel/cpu/resctrl/core.c
fs/resctrl/ctrlmondata.c
fs/resctrl/internal.h
fs/resctrl/monitor.c
fs/resctrl/rdtgroup.c
include/linux/resctrl.h