]> git.baikalelectronics.ru Git - kernel.git/commit
x86: make embedding percpu allocator return excessive free space
authorTejun Heo <tj@kernel.org>
Fri, 6 Mar 2009 05:33:59 +0000 (14:33 +0900)
committerTejun Heo <tj@kernel.org>
Fri, 6 Mar 2009 05:33:59 +0000 (14:33 +0900)
commit350543e125a18ad7d56d5726d03013a74d2b0456
treebe7075427a064709bf1a3d3184c7cc3dc147d6e8
parent2e1698454d508291866d52cf9c733d7849045eda
x86: make embedding percpu allocator return excessive free space

Impact: reduce unnecessary memory usage on certain configurations

Embedding percpu allocator allocates unit_size *
smp_num_possible_cpus() bytes consecutively and use it for the first
chunk.  However, if the static area is small, this can result in
excessive prellocated free space in the first chunk due to
PCPU_MIN_UNIT_SIZE restriction.

This patch makes embedding percpu allocator preallocate only what's
necessary as described by PERPCU_DYNAMIC_RESERVE and return the
leftover to the bootmem allocator.

Signed-off-by: Tejun Heo <tj@kernel.org>
arch/x86/kernel/setup_percpu.c