x86,percpu: generalize lpage first chunk allocator
authorTejun Heo <tj@kernel.org>
Fri, 3 Jul 2009 23:10:59 +0000 (08:10 +0900)
committerTejun Heo <tj@kernel.org>
Fri, 3 Jul 2009 23:10:59 +0000 (08:10 +0900)
commit8c4bfc6e8801616ab2e01c38140b2159b388d2ff
treee29e8bbfae362362554b870371a6187b41f92d82
parent8f05a6a65d944f2fed4eb384fb58aa8c8e5a9bab
x86,percpu: generalize lpage first chunk allocator

Generalize and move x86 setup_pcpu_lpage() into
pcpu_lpage_first_chunk().  setup_pcpu_lpage() now is a simple wrapper
around the generalized version.  Other than taking size parameters and
using arch supplied callbacks to allocate/free/map memory,
pcpu_lpage_first_chunk() is identical to the original implementation.

This simplifies arch code and will help converting more archs to
dynamic percpu allocator.

While at it, factor out pcpu_calc_fc_sizes() which is common to
pcpu_embed_first_chunk() and pcpu_lpage_first_chunk().

[ Impact: code reorganization and generalization ]

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Ingo Molnar <mingo@elte.hu>
arch/x86/include/asm/percpu.h
arch/x86/kernel/setup_percpu.c
arch/x86/mm/pageattr.c
include/linux/percpu.h
mm/percpu.c