lkml.org 
[lkml]   [2008]   [Nov]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 05/15] kmemleak: Add the slub memory allocation/freeing hooks
Hi Catalin,

Please use the penberg@cs.helsinki.fi email address when cc'ing me.

On Sat, Nov 29, 2008 at 12:43 PM, Catalin Marinas
<catalin.marinas@arm.com> wrote:
> This patch adds the callbacks to memleak_(alloc|free) functions from the
> slub allocator.
>
> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
> Cc: Ingo Molnar <mingo@elte.hu>
> Cc: Pekka Enberg <penberg@gmail.com>
> Cc: Christoph Lameter <cl@linux-foundation.org>

Looks good to me.

Acked-by: Pekka Enberg <penberg@cs.helsinki.fi>

> ---
> mm/slub.c | 5 ++++-
> 1 files changed, 4 insertions(+), 1 deletions(-)
>
> diff --git a/mm/slub.c b/mm/slub.c
> index 7ad489a..b683571 100644
> --- a/mm/slub.c
> +++ b/mm/slub.c
> @@ -18,6 +18,7 @@
> #include <linux/seq_file.h>
> #include <linux/cpu.h>
> #include <linux/cpuset.h>
> +#include <linux/memleak.h>
> #include <linux/mempolicy.h>
> #include <linux/ctype.h>
> #include <linux/debugobjects.h>
> @@ -140,7 +141,7 @@
> * Set of flags that will prevent slab merging
> */
> #define SLUB_NEVER_MERGE (SLAB_RED_ZONE | SLAB_POISON | SLAB_STORE_USER | \
> - SLAB_TRACE | SLAB_DESTROY_BY_RCU)
> + SLAB_TRACE | SLAB_DESTROY_BY_RCU | SLAB_NOLEAKTRACE)
>
> #define SLUB_MERGE_SAME (SLAB_DEBUG_FREE | SLAB_RECLAIM_ACCOUNT | \
> SLAB_CACHE_DMA)
> @@ -1608,6 +1609,7 @@ static __always_inline void *slab_alloc(struct kmem_cache *s,
> if (unlikely((gfpflags & __GFP_ZERO) && object))
> memset(object, 0, objsize);
>
> + memleak_alloc_recursive(object, objsize, 1, s->flags);
> return object;
> }
>
> @@ -1710,6 +1712,7 @@ static __always_inline void slab_free(struct kmem_cache *s,
> struct kmem_cache_cpu *c;
> unsigned long flags;
>
> + memleak_free_recursive(x, s->flags);
> local_irq_save(flags);
> c = get_cpu_slab(s, smp_processor_id());
> debug_check_no_locks_freed(object, c->objsize);
>
>


\
 
 \ /
  Last update: 2008-11-29 12:49    [W:0.712 / U:0.136 seconds]
©2003-2014 Jasper Spaans. Advertise on this site