s390/cache: prevent rebuild of shared_cpu_list
authorHeiko Carstens <hca@linux.ibm.com>
Sat, 2 Mar 2024 19:22:09 +0000 (20:22 +0100)
committerHeiko Carstens <hca@linux.ibm.com>
Thu, 7 Mar 2024 13:41:15 +0000 (14:41 +0100)
With commit 36bbc5b4ffab ("cacheinfo: Allow early detection and population
of cache attributes") the shared cpu list for each cache level higher than
L1 is rebuilt even if the list already has been set up.

This is caused by the removal of the cpumask_empty() check within
cache_shared_cpu_map_setup().

However architectures can enforce that the shared cpu list is not rebuilt
by simply setting cpu_map_populated of the per cpu cache info structure to
true, which is also the fix for this problem.

Before:
$ cat /sys/devices/system/cpu/cpu1/cache/index2/shared_cpu_list
0-7

After:
$ cat /sys/devices/system/cpu/cpu1/cache/index2/shared_cpu_list
1

Fixes: 36bbc5b4ffab ("cacheinfo: Allow early detection and population of cache attributes")
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
arch/s390/kernel/cache.c

index 56254fa06f990614179c1f357f7c9f28afafc7cb..4f266903022091921be3fd97c200f4210627a948 100644 (file)
@@ -166,5 +166,6 @@ int populate_cache_leaves(unsigned int cpu)
                        ci_leaf_init(this_leaf++, pvt, ctype, level, cpu);
                }
        }
+       this_cpu_ci->cpu_map_populated = true;
        return 0;
 }