diff options
author | Christoph Lameter <cl@linux.com> | 2010-08-20 13:37:14 -0400 |
---|---|---|
committer | Pekka Enberg <penberg@kernel.org> | 2010-10-02 03:24:26 -0400 |
commit | 6c182dc0de26ef97efb6a97a8deab074833764e7 (patch) | |
tree | ef6d4278579ce30117e6095804e861ac35095a43 /mm/slub.c | |
parent | 55136592fedf5cc58c03d9b5eb66103a9013d4e5 (diff) |
slub: Remove static kmem_cache_cpu array for boot
The percpu allocator can now handle allocations during early boot.
So drop the static kmem_cache_cpu array.
Cc: Tejun Heo <tj@kernel.org>
Acked-by: David Rientjes <rientjes@google.com>
Signed-off-by: Christoph Lameter <cl@linux-foundation.org>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
Diffstat (limited to 'mm/slub.c')
-rw-r--r-- | mm/slub.c | 17 |
1 files changed, 4 insertions, 13 deletions
@@ -2062,23 +2062,14 @@ init_kmem_cache_node(struct kmem_cache_node *n, struct kmem_cache *s) | |||
2062 | #endif | 2062 | #endif |
2063 | } | 2063 | } |
2064 | 2064 | ||
2065 | static DEFINE_PER_CPU(struct kmem_cache_cpu, kmalloc_percpu[KMALLOC_CACHES]); | ||
2066 | |||
2067 | static inline int alloc_kmem_cache_cpus(struct kmem_cache *s) | 2065 | static inline int alloc_kmem_cache_cpus(struct kmem_cache *s) |
2068 | { | 2066 | { |
2069 | if (s < kmalloc_caches + KMALLOC_CACHES && s >= kmalloc_caches) | 2067 | BUILD_BUG_ON(PERCPU_DYNAMIC_EARLY_SIZE < |
2070 | /* | 2068 | SLUB_PAGE_SHIFT * sizeof(struct kmem_cache_cpu)); |
2071 | * Boot time creation of the kmalloc array. Use static per cpu data | ||
2072 | * since the per cpu allocator is not available yet. | ||
2073 | */ | ||
2074 | s->cpu_slab = kmalloc_percpu + (s - kmalloc_caches); | ||
2075 | else | ||
2076 | s->cpu_slab = alloc_percpu(struct kmem_cache_cpu); | ||
2077 | 2069 | ||
2078 | if (!s->cpu_slab) | 2070 | s->cpu_slab = alloc_percpu(struct kmem_cache_cpu); |
2079 | return 0; | ||
2080 | 2071 | ||
2081 | return 1; | 2072 | return s->cpu_slab != NULL; |
2082 | } | 2073 | } |
2083 | 2074 | ||
2084 | #ifdef CONFIG_NUMA | 2075 | #ifdef CONFIG_NUMA |