slab: fix to calm down kmemleak warning

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Fri Nov 22 17:59:03 EST 2013


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=0172f779e4314639a8ed440082cfe9e3450954e8
Commit:     0172f779e4314639a8ed440082cfe9e3450954e8
Parent:     e7444d9b7d49898a667074122bed2dcedf349305
Author:     Joonsoo Kim <iamjoonsoo.kim at lge.com>
AuthorDate: Wed Oct 30 19:04:00 2013 +0900
Committer:  Pekka Enberg <penberg at iki.fi>
CommitDate: Wed Oct 30 14:08:52 2013 +0200

    slab: fix to calm down kmemleak warning
    
    After using struct page as slab management, we should not call
    kmemleak_scan_area(), since struct page isn't the tracking object of
    kmemleak. Without this patch and if CONFIG_DEBUG_KMEMLEAK is enabled,
    so many kmemleak warnings are printed.
    
    Signed-off-by: Joonsoo Kim <iamjoonsoo.kim at lge.com>
    Signed-off-by: Pekka Enberg <penberg at iki.fi>
---
 mm/slab.c | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/mm/slab.c b/mm/slab.c
index af2db76..a8a9349 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -2531,14 +2531,6 @@ static struct freelist *alloc_slabmgmt(struct kmem_cache *cachep,
 		/* Slab management obj is off-slab. */
 		freelist = kmem_cache_alloc_node(cachep->freelist_cache,
 					      local_flags, nodeid);
-		/*
-		 * If the first object in the slab is leaked (it's allocated
-		 * but no one has a reference to it), we want to make sure
-		 * kmemleak does not treat the ->s_mem pointer as a reference
-		 * to the object. Otherwise we will not report the leak.
-		 */
-		kmemleak_scan_area(&page->lru, sizeof(struct list_head),
-				   local_flags);
 		if (!freelist)
 			return NULL;
 	} else {



More information about the linux-mtd-cvs mailing list