|| ||Tejun Heo <email@example.com>|
|| ||firstname.lastname@example.org, email@example.com, firstname.lastname@example.org,
email@example.com, firstname.lastname@example.org, email@example.com,
Paul Mundt <firstname.lastname@example.org>, email@example.com,
|| ||[GIT RFC] percpu: use dynamic percpu allocator as the default percpu allocator|
|| ||Tue, 10 Mar 2009 16:53:46 +0900|
|| ||Article, Thread
This patchset converts all SMP-capable arches other than three
non-trivial ones - powerpc64, sparc64 and ia64 - to use dynamic percpu
allocator. The affected archs are
The x86 embedding first chunk allocator is generalized and used as the
default first chunk allocator. This first chunk allocator makes the
dynamic percpu allocator behave mostly identically to the previous
generic percpu allocator. Percpu memory is allocated using
alloc_bootmem_pages() and module static percpu variables are allocated
right after core percpu variables.
The only differences are 1. there can be more space between percpu
areas for each cpu to accomodate minimum allocation size and first
chunk dynamic reserve and 2. dynamic percpu variables use the same
address translation mechanism as static ones.
#1 shouldn't cause any trouble and #2 shouldn't too because the
offsets for dynamic percpu variables are carried in full pointer-width
variables, so as long as the calculations don't make wrong assumptions
(should be masked by RELOC_HIDE), it should be okay, but if your arch
has addressing limitations (alpha, s390), please take a second look.
I really wanted to test it on an architecture which is actually
affected by this change but my powerstation wouldn't boot 32bit
kernel, qemu-system-sparc doesn't like SMP kernels and I don't have
access to a sparc, alpha or SMP arm, so I could only tested it on
x86_32 with a patch to use the generic default allocator. It works
fine there and compiles fine for sparc(32), powerpc(32), alpha and
arm. If you have an access to one of the affected archs, please test
and report the result. I'll send a test module as a reply to this
message. If you can boot and load/unload the module, it should be
This patchset is on top of the current x86/core/percpu and contains
the following patches.
0001-0004 preps. 0005 does the conversion.
This patchset is available in the following git tree.
Ingo, I think it would be best to delay pulling till at least some of
the archs have been confirmed.
arch/arm/kernel/vmlinux.lds.S | 1
arch/ia64/Kconfig | 3
arch/ia64/kernel/vmlinux.lds.S | 12 --
arch/powerpc/Kconfig | 3
arch/powerpc/kernel/vmlinux.lds.S | 9 --
arch/sparc/Kconfig | 3
arch/x86/Kconfig | 3
arch/x86/include/asm/percpu.h | 8 -
arch/x86/kernel/setup_percpu.c | 63 ++------------
include/linux/percpu.h | 18 +++-
init/main.c | 24 -----
kernel/module.c | 6 -
mm/Makefile | 2
mm/percpu.c | 170 ++++++++++++++++++++++++++++++++++----
14 files changed, 195 insertions(+), 130 deletions(-)