Commit 966730a6 authored by Srikar Dronamraju's avatar Srikar Dronamraju Committed by Michael Ellerman

powerpc/smp: Remove unnecessary variable

Commit 3ab33d6d ("powerpc/smp: Optimize update_mask_by_l2")
introduced submask_fn in update_mask_by_l2 to track the right submask.
However commit f6606cfd ("powerpc/smp: Dont assume l2-cache to be
superset of sibling") introduced sibling_mask in update_mask_by_l2 to
track the same submask. Remove sibling_mask in favour of submask_fn.
Signed-off-by: default avatarSrikar Dronamraju <srikar@linux.vnet.ibm.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20201019042716.106234-2-srikar@linux.vnet.ibm.com
parent 8d0e2101
...@@ -1247,18 +1247,16 @@ static bool update_mask_by_l2(int cpu) ...@@ -1247,18 +1247,16 @@ static bool update_mask_by_l2(int cpu)
cpumask_var_t mask; cpumask_var_t mask;
int i; int i;
if (has_big_cores)
submask_fn = cpu_smallcore_mask;
l2_cache = cpu_to_l2cache(cpu); l2_cache = cpu_to_l2cache(cpu);
if (!l2_cache) { if (!l2_cache) {
struct cpumask *(*sibling_mask)(int) = cpu_sibling_mask;
/* /*
* If no l2cache for this CPU, assume all siblings to share * If no l2cache for this CPU, assume all siblings to share
* cache with this CPU. * cache with this CPU.
*/ */
if (has_big_cores) for_each_cpu(i, submask_fn(cpu))
sibling_mask = cpu_smallcore_mask;
for_each_cpu(i, sibling_mask(cpu))
set_cpus_related(cpu, i, cpu_l2_cache_mask); set_cpus_related(cpu, i, cpu_l2_cache_mask);
return false; return false;
...@@ -1267,9 +1265,6 @@ static bool update_mask_by_l2(int cpu) ...@@ -1267,9 +1265,6 @@ static bool update_mask_by_l2(int cpu)
alloc_cpumask_var_node(&mask, GFP_KERNEL, cpu_to_node(cpu)); alloc_cpumask_var_node(&mask, GFP_KERNEL, cpu_to_node(cpu));
cpumask_and(mask, cpu_online_mask, cpu_cpu_mask(cpu)); cpumask_and(mask, cpu_online_mask, cpu_cpu_mask(cpu));
if (has_big_cores)
submask_fn = cpu_smallcore_mask;
/* Update l2-cache mask with all the CPUs that are part of submask */ /* Update l2-cache mask with all the CPUs that are part of submask */
or_cpumasks_related(cpu, cpu, submask_fn, cpu_l2_cache_mask); or_cpumasks_related(cpu, cpu, submask_fn, cpu_l2_cache_mask);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment