]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/mm/slice: implement slice_check_range_fits
authorNicholas Piggin <npiggin@gmail.com>
Wed, 7 Mar 2018 01:37:13 +0000 (11:37 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Tue, 13 Mar 2018 12:43:06 +0000 (23:43 +1100)
commit6c28a33bae61d53f43964b8f30f2c76fdd5c8fd8
tree62c3cb32111f029f4eb4c8a4022bde9bcfdfb369
parenta1ad495a5058f7c3d05647a7cfbfeaecf944311b
powerpc/mm/slice: implement slice_check_range_fits

Rather than build slice masks from a range then use that to check for
fit in a candidate mask, implement slice_check_range_fits that checks
if a range fits in a mask directly.

This allows several structures to be removed from stacks, and also we
don't expect a huge range in a lot of these cases, so building and
comparing a full mask is going to be more expensive than testing just
one or two bits of the range.

On POWER8, this increases vfork+exec+exit performance by 0.3%
and reduces time to mmap+munmap a 64kB page by 5%.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/mm/slice.c