diff options
author | Tejun Heo <tj@kernel.org> | 2009-08-14 02:00:52 -0400 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2009-08-14 02:00:52 -0400 |
commit | c8826dd538602d730ed2c18c6753f1bbfa6c4933 (patch) | |
tree | 705a34d5afae4a53a1b041689b0b0079cd88f737 /arch | |
parent | 6563297ceafab6bbcc931b52e2a9e660fbb21fb2 (diff) |
percpu: update embedding first chunk allocator to handle sparse units
Now that percpu core can handle very sparse units, given that vmalloc
space is large enough, embedding first chunk allocator can use any
memory to build the first chunk. This patch teaches
pcpu_embed_first_chunk() about distances between cpus and to use
alloc/free callbacks to allocate node specific areas for each group
and use them for the first chunk.
This brings the benefits of embedding allocator to NUMA configurations
- no extra TLB pressure with the flexibility of unified dynamic
allocator and no need to restructure arch code to build memory layout
suitable for percpu. With units put into atom_size aligned groups
according to cpu distances, using large page for dynamic chunks is
also easily possible with falling back to reuglar pages if large
allocation fails.
Embedding allocator users are converted to specify NULL
cpu_distance_fn, so this patch doesn't cause any visible behavior
difference. Following patches will convert them.
Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/kernel/setup_percpu.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/x86/kernel/setup_percpu.c b/arch/x86/kernel/setup_percpu.c index 9becc5d4b518..67f6314de9f1 100644 --- a/arch/x86/kernel/setup_percpu.c +++ b/arch/x86/kernel/setup_percpu.c | |||
@@ -234,7 +234,9 @@ static int __init setup_pcpu_embed(bool chosen) | |||
234 | return -EINVAL; | 234 | return -EINVAL; |
235 | 235 | ||
236 | return pcpu_embed_first_chunk(PERCPU_FIRST_CHUNK_RESERVE, | 236 | return pcpu_embed_first_chunk(PERCPU_FIRST_CHUNK_RESERVE, |
237 | reserve - PERCPU_FIRST_CHUNK_RESERVE); | 237 | reserve - PERCPU_FIRST_CHUNK_RESERVE, |
238 | PAGE_SIZE, NULL, pcpu_fc_alloc, | ||
239 | pcpu_fc_free); | ||
238 | } | 240 | } |
239 | 241 | ||
240 | /* | 242 | /* |