|
@@ -2995,8 +2995,6 @@ void __init kmem_cache_init(void)
|
|
create_kmalloc_cache(&kmalloc_caches[1],
|
|
create_kmalloc_cache(&kmalloc_caches[1],
|
|
"kmalloc-96", 96, GFP_KERNEL);
|
|
"kmalloc-96", 96, GFP_KERNEL);
|
|
caches++;
|
|
caches++;
|
|
- }
|
|
|
|
- if (KMALLOC_MIN_SIZE <= 128) {
|
|
|
|
create_kmalloc_cache(&kmalloc_caches[2],
|
|
create_kmalloc_cache(&kmalloc_caches[2],
|
|
"kmalloc-192", 192, GFP_KERNEL);
|
|
"kmalloc-192", 192, GFP_KERNEL);
|
|
caches++;
|
|
caches++;
|
|
@@ -3026,6 +3024,16 @@ void __init kmem_cache_init(void)
|
|
for (i = 8; i < KMALLOC_MIN_SIZE; i += 8)
|
|
for (i = 8; i < KMALLOC_MIN_SIZE; i += 8)
|
|
size_index[(i - 1) / 8] = KMALLOC_SHIFT_LOW;
|
|
size_index[(i - 1) / 8] = KMALLOC_SHIFT_LOW;
|
|
|
|
|
|
|
|
+ if (KMALLOC_MIN_SIZE == 128) {
|
|
|
|
+ /*
|
|
|
|
+ * The 192 byte sized cache is not used if the alignment
|
|
|
|
+ * is 128 byte. Redirect kmalloc to use the 256 byte cache
|
|
|
|
+ * instead.
|
|
|
|
+ */
|
|
|
|
+ for (i = 128 + 8; i <= 192; i += 8)
|
|
|
|
+ size_index[(i - 1) / 8] = 8;
|
|
|
|
+ }
|
|
|
|
+
|
|
slab_state = UP;
|
|
slab_state = UP;
|
|
|
|
|
|
/* Provide the correct kmalloc names now that the caches are up */
|
|
/* Provide the correct kmalloc names now that the caches are up */
|