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, David Rientjes wrote:

> On Thu, 2 Aug 2012, Christoph Lameter wrote:
>
> > This condition is pretty serious. The free action will be skipped
> > and we will be continually leaking memory. I think its best to keep on
> > logging this until someohne does something about the problem.
> >
>
> Dozens of lines will be emitted to the kernel log because a stack trace is
> printed every time a bogus kmem_cache_free() is called, perhaps change the
> WARN_ON(1) to at least a WARN_ON_ONCE(1)?

Ok,

Subject: Only warn once

Signed-off-by: Christoph Lameter <cl@xxxxxxxxx>

Index: linux-2.6/mm/slub.c
===================================================================
--- linux-2.6.orig/mm/slub.c	2012-08-03 08:43:34.772602802 -0500
+++ linux-2.6/mm/slub.c	2012-08-03 08:44:36.021655892 -0500
@@ -2610,7 +2610,7 @@ void kmem_cache_free(struct kmem_cache *
 	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);
+		WARN_ON_ONCE(1);
 		return;
 	}

--
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]