From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail190.messagelabs.com (mail190.messagelabs.com [216.82.249.51]) by kanga.kvack.org (Postfix) with SMTP id 07BC36B01F3 for ; Tue, 17 Aug 2010 17:11:38 -0400 (EDT) Message-Id: <20100817211136.091336874@linux.com> Date: Tue, 17 Aug 2010 16:11:21 -0500 From: Christoph Lameter Subject: [S+Q Cleanup 3/6] slub: Remove static kmem_cache_cpu array for boot References: <20100817211118.958108012@linux.com> Content-Disposition: inline; filename=maybe_remove_static Sender: owner-linux-mm@kvack.org To: Pekka Enberg Cc: linux-mm@kvack.org, Tejun Heo , David Rientjes List-ID: The percpu allocator can now handle allocations during early boot. So drop the static kmem_cache_cpu array. Cc: Tejun Heo Signed-off-by: Christoph Lameter --- mm/slub.c | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) Index: linux-2.6/mm/slub.c =================================================================== --- linux-2.6.orig/mm/slub.c 2010-08-13 10:32:45.000000000 -0500 +++ linux-2.6/mm/slub.c 2010-08-13 10:32:50.000000000 -0500 @@ -2062,23 +2062,14 @@ init_kmem_cache_node(struct kmem_cache_n #endif } -static DEFINE_PER_CPU(struct kmem_cache_cpu, kmalloc_percpu[KMALLOC_CACHES]); - static inline int alloc_kmem_cache_cpus(struct kmem_cache *s) { - if (s < kmalloc_caches + KMALLOC_CACHES && s >= kmalloc_caches) - /* - * Boot time creation of the kmalloc array. Use static per cpu data - * since the per cpu allocator is not available yet. - */ - s->cpu_slab = kmalloc_percpu + (s - kmalloc_caches); - else - s->cpu_slab = alloc_percpu(struct kmem_cache_cpu); + BUILD_BUG_ON(PERCPU_DYNAMIC_EARLY_SIZE < + SLUB_PAGE_SHIFT * sizeof(struct kmem_cache)); - if (!s->cpu_slab) - return 0; + s->cpu_slab = alloc_percpu(struct kmem_cache_cpu); - return 1; + return s->cpu_slab != NULL; } #ifdef CONFIG_NUMA -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org