powerpc/smp: Optimize update_mask_by_l2
authorSrikar Dronamraju <srikar@linux.vnet.ibm.com>
Mon, 21 Sep 2020 09:56:51 +0000 (15:26 +0530)
committerMichael Ellerman <mpe@ellerman.id.au>
Tue, 6 Oct 2020 12:22:27 +0000 (23:22 +1100)
commit3ab33d6dc3e98e83b55732049e1d1d488207bb6d
tree7260a6b198ca3598505ab5906242d394660428e5
parent375370a10d061d5c75c6bc5b09c5db4cc0b0fcfe
powerpc/smp: Optimize update_mask_by_l2

All threads of a SMT4 core can either be part of this CPU's l2-cache
mask or not related to this CPU l2-cache mask. Use this relation to
reduce the number of iterations needed to find all the CPUs that share
the same l2-cache.

Use a temporary mask to iterate through the CPUs that may share l2_cache
mask. Also instead of setting one CPU at a time into cpu_l2_cache_mask,
copy the SMT4/sub mask at one shot.

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/20200921095653.9701-10-srikar@linux.vnet.ibm.com
arch/powerpc/kernel/smp.c