Add additional debugging to check that the objects is actually from the cache the caller claims. Doing so currently trips up some other debugging code. It takes a lot to infer from that what was happening. V2: Only warn once. Signed-off-by: Christoph Lameter Index: linux-2.6/mm/slub.c =================================================================== --- linux-2.6.orig/mm/slub.c 2012-08-03 14:16:27.396663869 -0500 +++ linux-2.6/mm/slub.c 2012-08-03 14:16:38.664866880 -0500 @@ -2607,6 +2607,13 @@ void kmem_cache_free(struct kmem_cache * page = virt_to_head_page(x); + if (kmem_cache_debug(s) && page->slab != s) { + printk("kmem_cache_free: Wrong slab cache. %s but object" + " is from %s\n", page->slab->name, s->name); + WARN_ON_ONCE(1); + return; + } + slab_free(s, page, x, _RET_IP_); trace_kmem_cache_free(_RET_IP_, x); -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org