diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-17 16:00:19 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-17 16:00:19 -0800 |
commit | dcc7cd011220d7425a265c9bbf04c5731dacec1b (patch) | |
tree | 4c2244f6e6ce94e2698572e9d2df3baea8449c2a /mm/slab.c | |
parent | bf931a01a2c024a54204b4b02276af6e8d99a2c0 (diff) | |
parent | b60e26a2f03d963f8c79ad7920d64abc4d38ecbc (diff) | |
download | lwn-dcc7cd011220d7425a265c9bbf04c5731dacec1b.tar.gz lwn-dcc7cd011220d7425a265c9bbf04c5731dacec1b.zip |
Merge branch 'kmemleak' of git://linux-arm.org/linux-2.6
* 'kmemleak' of git://linux-arm.org/linux-2.6:
kmemleak: fix kconfig for crc32 build error
kmemleak: Reduce the false positives by checking for modified objects
kmemleak: Show the age of an unreferenced object
kmemleak: Release the object lock before calling put_object()
kmemleak: Scan the _ftrace_events section in modules
kmemleak: Simplify the kmemleak_scan_area() function prototype
kmemleak: Do not use off-slab management with SLAB_NOLEAKTRACE
Diffstat (limited to 'mm/slab.c')
-rw-r--r-- | mm/slab.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/mm/slab.c b/mm/slab.c index 3f4822938f46..e17cc2c337b8 100644 --- a/mm/slab.c +++ b/mm/slab.c @@ -2275,9 +2275,11 @@ kmem_cache_create (const char *name, size_t size, size_t align, /* * Determine if the slab management is 'on' or 'off' slab. * (bootstrapping cannot cope with offslab caches so don't do - * it too early on.) + * it too early on. Always use on-slab management when + * SLAB_NOLEAKTRACE to avoid recursive calls into kmemleak) */ - if ((size >= (PAGE_SIZE >> 3)) && !slab_early_init) + if ((size >= (PAGE_SIZE >> 3)) && !slab_early_init && + !(flags & SLAB_NOLEAKTRACE)) /* * Size is large, assume best to place the slab management obj * off-slab (should allow better packing of objs). @@ -2596,8 +2598,8 @@ static struct slab *alloc_slabmgmt(struct kmem_cache *cachep, void *objp, * kmemleak does not treat the ->s_mem pointer as a reference * to the object. Otherwise we will not report the leak. */ - kmemleak_scan_area(slabp, offsetof(struct slab, list), - sizeof(struct list_head), local_flags); + kmemleak_scan_area(&slabp->list, sizeof(struct list_head), + local_flags); if (!slabp) return NULL; } else { |