diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-06-11 17:15:57 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-06-11 17:15:57 -0400 |
commit | 512626a04e72aca60effe111fa0333ed0b195d21 (patch) | |
tree | c22e23b0dcc2dd2ff5a9a96a007de6799e9223de /mm/slub.c | |
parent | 8a1ca8cedd108c8e76a6ab34079d0bbb4f244799 (diff) | |
parent | 3aa27bbe7a6536d1ec859d3a97caf3319b5081b7 (diff) |
Merge branch 'for-linus' of git://linux-arm.org/linux-2.6
* 'for-linus' of git://linux-arm.org/linux-2.6:
kmemleak: Add the corresponding MAINTAINERS entry
kmemleak: Simple testing module for kmemleak
kmemleak: Enable the building of the memory leak detector
kmemleak: Remove some of the kmemleak false positives
kmemleak: Add modules support
kmemleak: Add kmemleak_alloc callback from alloc_large_system_hash
kmemleak: Add the vmalloc memory allocation/freeing hooks
kmemleak: Add the slub memory allocation/freeing hooks
kmemleak: Add the slob memory allocation/freeing hooks
kmemleak: Add the slab memory allocation/freeing hooks
kmemleak: Add documentation on the memory leak detector
kmemleak: Add the base support
Manual conflict resolution (with the slab/earlyboot changes) in:
drivers/char/vt.c
init/main.c
mm/slab.c
Diffstat (limited to 'mm/slub.c')
-rw-r--r-- | mm/slub.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -20,6 +20,7 @@ | |||
20 | #include <linux/kmemtrace.h> | 20 | #include <linux/kmemtrace.h> |
21 | #include <linux/cpu.h> | 21 | #include <linux/cpu.h> |
22 | #include <linux/cpuset.h> | 22 | #include <linux/cpuset.h> |
23 | #include <linux/kmemleak.h> | ||
23 | #include <linux/mempolicy.h> | 24 | #include <linux/mempolicy.h> |
24 | #include <linux/ctype.h> | 25 | #include <linux/ctype.h> |
25 | #include <linux/debugobjects.h> | 26 | #include <linux/debugobjects.h> |
@@ -143,7 +144,7 @@ | |||
143 | * Set of flags that will prevent slab merging | 144 | * Set of flags that will prevent slab merging |
144 | */ | 145 | */ |
145 | #define SLUB_NEVER_MERGE (SLAB_RED_ZONE | SLAB_POISON | SLAB_STORE_USER | \ | 146 | #define SLUB_NEVER_MERGE (SLAB_RED_ZONE | SLAB_POISON | SLAB_STORE_USER | \ |
146 | SLAB_TRACE | SLAB_DESTROY_BY_RCU) | 147 | SLAB_TRACE | SLAB_DESTROY_BY_RCU | SLAB_NOLEAKTRACE) |
147 | 148 | ||
148 | #define SLUB_MERGE_SAME (SLAB_DEBUG_FREE | SLAB_RECLAIM_ACCOUNT | \ | 149 | #define SLUB_MERGE_SAME (SLAB_DEBUG_FREE | SLAB_RECLAIM_ACCOUNT | \ |
149 | SLAB_CACHE_DMA) | 150 | SLAB_CACHE_DMA) |
@@ -1617,6 +1618,7 @@ static __always_inline void *slab_alloc(struct kmem_cache *s, | |||
1617 | if (unlikely((gfpflags & __GFP_ZERO) && object)) | 1618 | if (unlikely((gfpflags & __GFP_ZERO) && object)) |
1618 | memset(object, 0, objsize); | 1619 | memset(object, 0, objsize); |
1619 | 1620 | ||
1621 | kmemleak_alloc_recursive(object, objsize, 1, s->flags, gfpflags); | ||
1620 | return object; | 1622 | return object; |
1621 | } | 1623 | } |
1622 | 1624 | ||
@@ -1746,6 +1748,7 @@ static __always_inline void slab_free(struct kmem_cache *s, | |||
1746 | struct kmem_cache_cpu *c; | 1748 | struct kmem_cache_cpu *c; |
1747 | unsigned long flags; | 1749 | unsigned long flags; |
1748 | 1750 | ||
1751 | kmemleak_free_recursive(x, s->flags); | ||
1749 | local_irq_save(flags); | 1752 | local_irq_save(flags); |
1750 | c = get_cpu_slab(s, smp_processor_id()); | 1753 | c = get_cpu_slab(s, smp_processor_id()); |
1751 | debug_check_no_locks_freed(object, c->objsize); | 1754 | debug_check_no_locks_freed(object, c->objsize); |