diff options
author | Linus Torvalds | 2008-07-04 09:48:21 -0700 |
---|---|---|
committer | Linus Torvalds | 2008-07-04 09:48:21 -0700 |
commit | 3ea9eed49346eb80f17f1c6539c47dc508be1173 (patch) | |
tree | a3e82cc6e3deded667a7eda071894c1ddf079db7 /mm | |
parent | 852bb9f594e0ea737f83487962a040ad210e8a13 (diff) | |
parent | 41d54d3bf83f62d3ff5948cb788fe6007e66a0d0 (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/penberg/slab-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/penberg/slab-2.6:
slub: Do not use 192 byte sized cache if minimum alignment is 128 byte
Diffstat (limited to 'mm')
-rw-r--r-- | mm/slub.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/mm/slub.c b/mm/slub.c index 0987d1cd943c..2c9a62d1f429 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -2995,8 +2995,6 @@ void __init kmem_cache_init(void) create_kmalloc_cache(&kmalloc_caches[1], "kmalloc-96", 96, GFP_KERNEL); caches++; - } - if (KMALLOC_MIN_SIZE <= 128) { create_kmalloc_cache(&kmalloc_caches[2], "kmalloc-192", 192, GFP_KERNEL); caches++; @@ -3026,6 +3024,16 @@ void __init kmem_cache_init(void) for (i = 8; i < KMALLOC_MIN_SIZE; i += 8) 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; /* Provide the correct kmalloc names now that the caches are up */ |