Skip to content

Commit

Permalink
slab: fix to calm down kmemleak warning
Browse files Browse the repository at this point in the history
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@lge.com>
Signed-off-by: Pekka Enberg <penberg@iki.fi>
  • Loading branch information
Joonsoo Kim authored and Pekka Enberg committed Oct 30, 2013
1 parent e7444d9 commit 0172f77
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions mm/slab.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 0172f77

Please sign in to comment.