--- mm/slub.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) Index: slub/mm/slub.c =================================================================== --- slub.orig/mm/slub.c 2007-05-25 09:17:33.000000000 -0700 +++ slub/mm/slub.c 2007-05-25 10:01:44.000000000 -0700 @@ -214,7 +214,7 @@ static inline void ClearSlabDebug(struct /* Internal SLUB flags */ #define __OBJECT_POISON 0x80000000 /* Poison object */ - +#define __NOMERGE 0x40000000 /* Dont merge this one */ /* Not all arches define cache_line_size */ #ifndef cache_line_size #define cache_line_size() L1_CACHE_BYTES @@ -2188,6 +2188,7 @@ static struct kmem_cache *create_kmalloc if (gfp_flags & SLUB_DMA) flags = SLAB_CACHE_DMA; + flags |= __NOMERGE; down_write(&slub_lock); if (!kmem_cache_open(s, gfp_flags, name, size, ARCH_KMALLOC_MINALIGN, @@ -2563,6 +2564,11 @@ struct kmem_cache *kmem_cache_create(con down_write(&slub_lock); s = find_mergeable(size, align, flags, ctor); if (s) { + if (s->flags & __NOMERGE) { + printk(KERN_ERR "Not merging slab %s into %s\n",name, s->name); + goto nope; + } + s->refcount++; /* * Adjust the object sizes so that we clear @@ -2573,6 +2579,7 @@ struct kmem_cache *kmem_cache_create(con if (sysfs_slab_alias(s, name)) goto err; } else { +nope: s = kmalloc(kmem_size, GFP_KERNEL); if (s && kmem_cache_open(s, GFP_KERNEL, name, size, align, flags, ctor)) {