slab: Common function to create the kmalloc array
[deliverable/linux.git] / mm / slub.c
index 527cbfb5c49bbdc60fbea2757ee686fcabfec440..e813c2d30fe0c9d95a3c941e7b79dc83527317e2 100644 (file)
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -3633,7 +3633,6 @@ void __init kmem_cache_init(void)
        static __initdata struct kmem_cache boot_kmem_cache,
                boot_kmem_cache_node;
        int i;
-       int caches = 2;
 
        if (debug_guardpage_minorder())
                slub_max_order = 0;
@@ -3703,64 +3702,16 @@ void __init kmem_cache_init(void)
                        size_index[size_index_elem(i)] = 8;
        }
 
-       /* Caches that are not of the two-to-the-power-of size */
-       if (KMALLOC_MIN_SIZE <= 32) {
-               kmalloc_caches[1] = create_kmalloc_cache("kmalloc-96", 96, 0);
-               caches++;
-       }
-
-       if (KMALLOC_MIN_SIZE <= 64) {
-               kmalloc_caches[2] = create_kmalloc_cache("kmalloc-192", 192, 0);
-               caches++;
-       }
-
-       for (i = KMALLOC_SHIFT_LOW; i <= KMALLOC_SHIFT_HIGH; i++) {
-               kmalloc_caches[i] = create_kmalloc_cache("kmalloc", 1 << i, 0);
-               caches++;
-       }
-
-       slab_state = UP;
-
-       /* Provide the correct kmalloc names now that the caches are up */
-       if (KMALLOC_MIN_SIZE <= 32) {
-               kmalloc_caches[1]->name = kstrdup(kmalloc_caches[1]->name, GFP_NOWAIT);
-               BUG_ON(!kmalloc_caches[1]->name);
-       }
-
-       if (KMALLOC_MIN_SIZE <= 64) {
-               kmalloc_caches[2]->name = kstrdup(kmalloc_caches[2]->name, GFP_NOWAIT);
-               BUG_ON(!kmalloc_caches[2]->name);
-       }
-
-       for (i = KMALLOC_SHIFT_LOW; i <= KMALLOC_SHIFT_HIGH; i++) {
-               char *s = kasprintf(GFP_NOWAIT, "kmalloc-%d", 1 << i);
-
-               BUG_ON(!s);
-               kmalloc_caches[i]->name = s;
-       }
+       create_kmalloc_caches(0);
 
 #ifdef CONFIG_SMP
        register_cpu_notifier(&slab_notifier);
 #endif
 
-#ifdef CONFIG_ZONE_DMA
-       for (i = 0; i <= KMALLOC_SHIFT_HIGH; i++) {
-               struct kmem_cache *s = kmalloc_caches[i];
-
-               if (s && s->size) {
-                       char *name = kasprintf(GFP_NOWAIT,
-                                "dma-kmalloc-%d", s->object_size);
-
-                       BUG_ON(!name);
-                       kmalloc_dma_caches[i] = create_kmalloc_cache(name,
-                               s->object_size, SLAB_CACHE_DMA);
-               }
-       }
-#endif
        printk(KERN_INFO
-               "SLUB: Genslabs=%d, HWalign=%d, Order=%d-%d, MinObjects=%d,"
+               "SLUB: HWalign=%d, Order=%d-%d, MinObjects=%d,"
                " CPUs=%d, Nodes=%d\n",
-               caches, cache_line_size(),
+               cache_line_size(),
                slub_min_order, slub_max_order, slub_min_objects,
                nr_cpu_ids, nr_node_ids);
 }
This page took 0.029721 seconds and 5 git commands to generate.