percpu: set PCPU_BITMAP_BLOCK_SIZE to PAGE_SIZE
authorDennis Zhou <dennis@kernel.org>
Wed, 13 Feb 2019 19:10:30 +0000 (11:10 -0800)
committerDennis Zhou <dennis@kernel.org>
Wed, 13 Mar 2019 19:25:31 +0000 (12:25 -0700)
commitb239f7daf5530f562000bf55f02cc8028703f507
tree699b64a042de071ada97dc59288d1882181b64b9
parent8744d859427c6198dce490619809754336954297
percpu: set PCPU_BITMAP_BLOCK_SIZE to PAGE_SIZE

Previously, block size was flexible based on the constraint that the
GCD(PCPU_BITMAP_BLOCK_SIZE, PAGE_SIZE) > 1. However, this carried the
overhead that keeping a floating number of populated free pages required
scanning over the free regions of a chunk.

Setting the block size to be fixed at PAGE_SIZE lets us know when an
empty page becomes used as we will break a full contig_hint of a block.
This means we no longer have to scan the whole chunk upon breaking a
contig_hint which empty page management piggybacked off. A later patch
takes advantage of this to optimize the allocation path by only scanning
forward using the scan_hint introduced later too.

Signed-off-by: Dennis Zhou <dennis@kernel.org>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
include/linux/percpu.h
mm/percpu-km.c
mm/percpu.c