On Thu, 2 Feb 2023 10:21:49 +0000 Hesham Almatary via Linaro-open-discussions linaro-open-discussions@op-lists.linaro.org wrote:
Could probably use cpumask_subset() instead of cpumask_equal() here, if, design-wise, resctrl allows a class to have a subset of all possible CPUs.
If there are 128 CPUs in the system, but there is one memory and/or cache MSC with affinity to a subset of these CPUs (e.g., 32 CPUs), caches/memories MSC won't be picked at all and nothing will appear in resctrl to manage valid MSCs.
This commit drops the assumption that caches or memory MSCs have affinity to the entire CPUs in the system.
Signed-off-by: Hesham Almatary hesham.almatary@huawei.com
drivers/platform/mpam/mpam_resctrl.c | 8 -------- 1 file changed, 8 deletions(-)
diff --git a/drivers/platform/mpam/mpam_resctrl.c b/drivers/platform/mpam/mpam_resctrl.c index bfc25a8e4f03..667670597f38 100644 --- a/drivers/platform/mpam/mpam_resctrl.c +++ b/drivers/platform/mpam/mpam_resctrl.c @@ -613,11 +613,6 @@ static void mpam_resctrl_pick_caches(void) continue; }
if (!cpumask_equal(&class->affinity,
cpu_possible_mask)) {
pr_debug("pick_caches: Class has missing
CPUs\n");
continue;
}
- /* Assume cache levels are the same size for all
CPUs... */ cache_size = get_cpu_cacheinfo_size(smp_processor_id(), class->level); if (!cache_size) { @@ -658,9 +653,6 @@ static void mpam_resctrl_pick_mba(void) if (!class_has_usable_mba(cprops)) continue;
if (!cpumask_equal(&class->affinity,
cpu_possible_mask))
continue;
- /*
- mba_sc reads the mbm_local counter, and waggles
the MBA controls. * mbm_local is implicitly part of the L3, pick a resouce to be MBA