mm/slub: create kmalloc 96 and 192 caches regardless cache size order
[linux-2.6-block.git] / mm / slab_common.c
index 67c03d6bd26cfb0523f05e5c09dcfdf7944eab08..7cfdcc8cbf5f8c3e97dee3bd3199c5a6e5e9be1f 100644 (file)
@@ -916,21 +916,16 @@ void __init create_kmalloc_caches(void)
         * Including KMALLOC_CGROUP if CONFIG_MEMCG_KMEM defined
         */
        for (type = KMALLOC_NORMAL; type < NR_KMALLOC_TYPES; type++) {
+               /* Caches that are NOT of the two-to-the-power-of size. */
+               if (KMALLOC_MIN_SIZE <= 32 && !kmalloc_caches[type][1])
+                       new_kmalloc_cache(1, type);
+               if (KMALLOC_MIN_SIZE <= 64 && !kmalloc_caches[type][2])
+                       new_kmalloc_cache(2, type);
+
+               /* Caches that are of the two-to-the-power-of size. */
                for (i = KMALLOC_SHIFT_LOW; i <= KMALLOC_SHIFT_HIGH; i++) {
                        if (!kmalloc_caches[type][i])
                                new_kmalloc_cache(i, type);
-
-                       /*
-                        * Caches that are not of the two-to-the-power-of size.
-                        * These have to be created immediately after the
-                        * earlier power of two caches
-                        */
-                       if (KMALLOC_MIN_SIZE <= 32 && i == 6 &&
-                                       !kmalloc_caches[type][1])
-                               new_kmalloc_cache(1, type);
-                       if (KMALLOC_MIN_SIZE <= 64 && i == 7 &&
-                                       !kmalloc_caches[type][2])
-                               new_kmalloc_cache(2, type);
                }
        }
 #ifdef CONFIG_RANDOM_KMALLOC_CACHES