Re: Common [01/19] slub: Add debugging to verify correct cache use on kmem_cache_free()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2 Aug 2012, Christoph Lameter wrote:

> 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.
> 
> Signed-off-by: Christoph Lameter <cl@xxxxxxxxx>

Acked-by: David Rientjes <rientjes@xxxxxxxxxx>

> Index: linux-2.6/mm/slub.c
> ===================================================================
> --- linux-2.6.orig/mm/slub.c	2012-08-02 13:52:35.314898373 -0500
> +++ linux-2.6/mm/slub.c	2012-08-02 13:52:38.662958767 -0500
> @@ -2607,6 +2607,13 @@
>  
>  	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(1);
> +		return;
> +	}
> +

This could quickly spam the kernel log depending on how frequently objects 
are being freed from the buggy callsite, should we disable further 
debugging for the cache in situations like this?

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]