]> git.baikalelectronics.ru Git - kernel.git/commit
percpu: increase minimum percpu allocation size and align first regions
authorDennis Zhou (Facebook) <dennisszhou@gmail.com>
Mon, 24 Jul 2017 23:02:09 +0000 (19:02 -0400)
committerTejun Heo <tj@kernel.org>
Wed, 26 Jul 2017 14:23:53 +0000 (10:23 -0400)
commit3e9fe95d1ee7ad2a4caf882c95bc2ec7acc623ed
treeebac3405bd4990d2ef6a527292b9c2c4f17e18f2
parent2d3ad9544e1d82a477d42eb540f90a2068f2e518
percpu: increase minimum percpu allocation size and align first regions

This patch increases the minimum allocation size of percpu memory to
4-bytes. This change will help minimize the metadata overhead
associated with the bitmap allocator. The assumption is that most
allocations will be of objects or structs greater than 2 bytes with
integers or longs being used rather than shorts.

The first chunk regions are now aligned with the minimum allocation
size. The reserved region is expected to be set as a multiple of the
minimum allocation size. The static region is aligned up and the delta
is removed from the dynamic size. This works because the dynamic size is
increased to be page aligned. If the static size is not minimum
allocation size aligned, then there must be a gap that is added to the
dynamic size. The dynamic size will never be smaller than the set value.

Signed-off-by: Dennis Zhou <dennisszhou@gmail.com>
Reviewed-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
include/linux/percpu.h
mm/percpu.c