aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2009-08-14 02:00:52 -0400
committerTejun Heo <tj@kernel.org>2009-08-14 02:00:52 -0400
commitc8826dd538602d730ed2c18c6753f1bbfa6c4933 (patch)
tree705a34d5afae4a53a1b041689b0b0079cd88f737 /include
parent6563297ceafab6bbcc931b52e2a9e660fbb21fb2 (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 'include')
-rw-r--r--include/linux/percpu.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/include/linux/percpu.h b/include/linux/percpu.h
index a7ec840f596c..25359932740e 100644
--- a/include/linux/percpu.h
+++ b/include/linux/percpu.h
@@ -110,8 +110,11 @@ extern int __init pcpu_setup_first_chunk(const struct pcpu_alloc_info *ai,
110 void *base_addr); 110 void *base_addr);
111 111
112#ifdef CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK 112#ifdef CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK
113extern int __init pcpu_embed_first_chunk(size_t reserved_size, 113extern int __init pcpu_embed_first_chunk(size_t reserved_size, ssize_t dyn_size,
114 ssize_t dyn_size); 114 size_t atom_size,
115 pcpu_fc_cpu_distance_fn_t cpu_distance_fn,
116 pcpu_fc_alloc_fn_t alloc_fn,
117 pcpu_fc_free_fn_t free_fn);
115#endif 118#endif
116 119
117#ifdef CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK 120#ifdef CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK