Skip to content

Commit 966730a

Browse files
srikardmpe
authored andcommitted
powerpc/smp: Remove unnecessary variable
Commit 3ab33d6 ("powerpc/smp: Optimize update_mask_by_l2") introduced submask_fn in update_mask_by_l2 to track the right submask. However commit f6606cf ("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: Srikar Dronamraju <srikar@linux.vnet.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/20201019042716.106234-2-srikar@linux.vnet.ibm.com
1 parent 8d0e210 commit 966730a

1 file changed

Lines changed: 4 additions & 9 deletions

File tree

arch/powerpc/kernel/smp.c

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1247,18 +1247,16 @@ static bool update_mask_by_l2(int cpu)
12471247
cpumask_var_t mask;
12481248
int i;
12491249

1250+
if (has_big_cores)
1251+
submask_fn = cpu_smallcore_mask;
1252+
12501253
l2_cache = cpu_to_l2cache(cpu);
12511254
if (!l2_cache) {
1252-
struct cpumask *(*sibling_mask)(int) = cpu_sibling_mask;
1253-
12541255
/*
12551256
* If no l2cache for this CPU, assume all siblings to share
12561257
* cache with this CPU.
12571258
*/
1258-
if (has_big_cores)
1259-
sibling_mask = cpu_smallcore_mask;
1260-
1261-
for_each_cpu(i, sibling_mask(cpu))
1259+
for_each_cpu(i, submask_fn(cpu))
12621260
set_cpus_related(cpu, i, cpu_l2_cache_mask);
12631261

12641262
return false;
@@ -1267,9 +1265,6 @@ static bool update_mask_by_l2(int cpu)
12671265
alloc_cpumask_var_node(&mask, GFP_KERNEL, cpu_to_node(cpu));
12681266
cpumask_and(mask, cpu_online_mask, cpu_cpu_mask(cpu));
12691267

1270-
if (has_big_cores)
1271-
submask_fn = cpu_smallcore_mask;
1272-
12731268
/* Update l2-cache mask with all the CPUs that are part of submask */
12741269
or_cpumasks_related(cpu, cpu, submask_fn, cpu_l2_cache_mask);
12751270

0 commit comments

Comments
 (0)