Skip to content

Commit

Permalink
slub: __kmalloc_node_track_caller should trace kmalloc_large_node case
Browse files Browse the repository at this point in the history
commit 94b528d (kmemtrace: SLUB hooks for caller-tracking functions)
missed tracing kmalloc_large_node in __kmalloc_node_track_caller. We
should trace it same as __kmalloc_node.

Acked-by: David Rientjes <rientjes@google.com>
Cc: Matt Mackall <mpm@selenic.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Vegard Nossum <vegard.nossum@gmail.com>
Signed-off-by: Xiaotian Feng <dfeng@redhat.com>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
  • Loading branch information
Xiaotian Feng authored and Pekka Enberg committed May 22, 2010
1 parent bbd7d57 commit d3e14aa
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions mm/slub.c
Original file line number Diff line number Diff line change
Expand Up @@ -3341,8 +3341,15 @@ void *__kmalloc_node_track_caller(size_t size, gfp_t gfpflags,
struct kmem_cache *s;
void *ret;

if (unlikely(size > SLUB_MAX_SIZE))
return kmalloc_large_node(size, gfpflags, node);
if (unlikely(size > SLUB_MAX_SIZE)) {
ret = kmalloc_large_node(size, gfpflags, node);

trace_kmalloc_node(caller, ret,
size, PAGE_SIZE << get_order(size),
gfpflags, node);

return ret;
}

s = get_slab(size, gfpflags);

Expand Down

0 comments on commit d3e14aa

Please sign in to comment.