Re: [PATCH 5/6] powerpc/mm: Optimize detection of thread local mm's
From: Michael Ellerman <mpe@ellerman.id.au>
Date: 2017-07-24 13:46:45
From: Michael Ellerman <mpe@ellerman.id.au>
Date: 2017-07-24 13:46:45
Nicholas Piggin [off-list ref] writes:
On Mon, 24 Jul 2017 14:28:02 +1000 Benjamin Herrenschmidt [off-list ref] wrote:quoted
Instead of comparing the whole CPU mask every time, let's keep a counter of how many bits are set in the mask. Thus testing for a local mm only requires testing if that counter is 1 and the current CPU bit is set in the mask.
...
Also does it make sense to define it based on NR_CPUS > BITS_PER_LONG? If it's <= then it should be similar load and compare, no?
Do we make a machine with that few CPUs? ;) I don't think it's worth special casing, all the distros run with much much larger NR_CPUs than that. cheers