aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorAlok Kataria <alokk@calsoftinc.com>2005-09-14 15:17:53 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-09-14 15:31:45 -0400
commitc7e43c78ae4d8630c418ce3495787b995e61a580 (patch)
tree40ab6278393ebb5096d1cef7bf1e7a423f4193de /mm
parentc7fb0b35ada6e0e691e70af5591a2006fbec85b5 (diff)
[PATCH] Fix slab BUG_ON() triggered by change in array cache size
With the new changes that we made in the initialization of the slab allocator, we first setup the cache from which array caches are allocated, and then the cache, from which kmem_list3's are allocated. Now if the array cache comes from a cache in which objsize > 32, (in this instance size-64) then, first size-64 cache will be allocated and then the size-128 (if this is the cache from which kmem_list3's are going to be allocated). So with these new changes, we are not guaranteed that we will be initializing the malloc_sizes array in a serialized order. Thus there is a bug in __find_general_cachep, as we are checking whether the first cache_sizes ptr is NULL. This is replaced by checking whether the array-cache cache is initialized. Attached is a patch which does that. Boots fine on a x86-64, with DEBUG_SPIN, DEBUG_SLAB, and preempt. Attached is a patch which does that. Boots fine on a x86-64, with DEBUG_SPIN, DEBUG_SLAB, and preempt.Thanks & Regards, Alok Signed-off-by: Alok N Kataria <alokk@calsoftinc.com> Signed-off-by: Shobhit Dayal <shobhitdayal.com> Cc: Manfred Spraul <manfred@colorfullife.com> Cc: Christoph Lameter <christoph@lameter.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/slab.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/slab.c b/mm/slab.c
index 9e876d6dfad9..437d3388054b 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -659,7 +659,7 @@ static inline kmem_cache_t *__find_general_cachep(size_t size,
659 * kmem_cache_create(), or __kmalloc(), before 659 * kmem_cache_create(), or __kmalloc(), before
660 * the generic caches are initialized. 660 * the generic caches are initialized.
661 */ 661 */
662 BUG_ON(csizep->cs_cachep == NULL); 662 BUG_ON(malloc_sizes[INDEX_AC].cs_cachep == NULL);
663#endif 663#endif
664 while (size > csizep->cs_size) 664 while (size > csizep->cs_size)
665 csizep++; 665 csizep++;