diff options
author | Tejun Heo <tj@kernel.org> | 2010-06-27 12:50:00 -0400 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2010-06-27 12:50:00 -0400 |
commit | 099a19d91ca429944743d51bef8fee240e94d8e3 (patch) | |
tree | 55bdc0f25ecbf38240782fb1d9a80d33c0100eb6 /init | |
parent | 4ba6ce250e406b20bcd6f0f3aed6b3d80965e6c2 (diff) |
percpu: allow limited allocation before slab is online
This patch updates percpu allocator such that it can serve limited
amount of allocation before slab comes online. This is primarily to
allow slab to depend on working percpu allocator.
Two parameters, PERCPU_DYNAMIC_EARLY_SIZE and SLOTS, determine how
much memory space and allocation map slots are reserved. If this
reserved area is exhausted, WARN_ON_ONCE() will trigger and allocation
will fail till slab comes online.
The following changes are made to implement early alloc.
* pcpu_mem_alloc() now checks slab_is_available()
* Chunks are allocated using pcpu_mem_alloc()
* Init paths make sure ai->dyn_size is at least as large as
PERCPU_DYNAMIC_EARLY_SIZE.
* Initial alloc maps are allocated in __initdata and copied to
kmalloc'd areas once slab is online.
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Christoph Lameter <cl@linux-foundation.org>
Diffstat (limited to 'init')
-rw-r--r-- | init/main.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/init/main.c b/init/main.c index 3bdb152f412f..3ff8dd0fb512 100644 --- a/init/main.c +++ b/init/main.c | |||
@@ -522,6 +522,7 @@ static void __init mm_init(void) | |||
522 | page_cgroup_init_flatmem(); | 522 | page_cgroup_init_flatmem(); |
523 | mem_init(); | 523 | mem_init(); |
524 | kmem_cache_init(); | 524 | kmem_cache_init(); |
525 | percpu_init_late(); | ||
525 | pgtable_cache_init(); | 526 | pgtable_cache_init(); |
526 | vmalloc_init(); | 527 | vmalloc_init(); |
527 | } | 528 | } |