* [PATCH] slub: __kmalloc_node_track_caller should trace kmalloc_large_node case
@ 2010-04-08 9:26 Xiaotian Feng
2010-04-08 19:03 ` David Rientjes
0 siblings, 1 reply; 3+ messages in thread
From: Xiaotian Feng @ 2010-04-08 9:26 UTC (permalink / raw)
To: linux-mm
Cc: linux-kernel, Xiaotian Feng, Pekka Enberg, Matt Mackall,
David Rientjes, Ingo Molnar, Vegard Nossum
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.
Signed-off-by: Xiaotian Feng <dfeng@redhat.com>
Cc: Pekka Enberg <penberg@cs.helsinki.fi>
Cc: Matt Mackall <mpm@selenic.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Vegard Nossum <vegard.nossum@gmail.com>
---
mm/slub.c | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/mm/slub.c b/mm/slub.c
index b364844..a3a5a18 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -3335,8 +3335,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);
--
1.7.0.1
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] slub: __kmalloc_node_track_caller should trace kmalloc_large_node case
2010-04-08 9:26 [PATCH] slub: __kmalloc_node_track_caller should trace kmalloc_large_node case Xiaotian Feng
@ 2010-04-08 19:03 ` David Rientjes
2010-04-11 6:40 ` Pekka Enberg
0 siblings, 1 reply; 3+ messages in thread
From: David Rientjes @ 2010-04-08 19:03 UTC (permalink / raw)
To: Xiaotian Feng
Cc: linux-mm, linux-kernel, Pekka Enberg, Matt Mackall, Ingo Molnar,
Vegard Nossum
On Thu, 8 Apr 2010, Xiaotian Feng wrote:
> 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.
>
> Signed-off-by: Xiaotian Feng <dfeng@redhat.com>
> Cc: Pekka Enberg <penberg@cs.helsinki.fi>
> Cc: Matt Mackall <mpm@selenic.com>
> Cc: David Rientjes <rientjes@google.com>
Acked-by: David Rientjes <rientjes@google.com>
> Cc: Ingo Molnar <mingo@elte.hu>
> Cc: Vegard Nossum <vegard.nossum@gmail.com>
> ---
> mm/slub.c | 11 +++++++++--
> 1 files changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/mm/slub.c b/mm/slub.c
> index b364844..a3a5a18 100644
> --- a/mm/slub.c
> +++ b/mm/slub.c
> @@ -3335,8 +3335,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);
>
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] slub: __kmalloc_node_track_caller should trace kmalloc_large_node case
2010-04-08 19:03 ` David Rientjes
@ 2010-04-11 6:40 ` Pekka Enberg
0 siblings, 0 replies; 3+ messages in thread
From: Pekka Enberg @ 2010-04-11 6:40 UTC (permalink / raw)
To: David Rientjes
Cc: Xiaotian Feng, linux-mm, linux-kernel, Matt Mackall, Ingo Molnar,
Vegard Nossum, cl
David Rientjes wrote:
> On Thu, 8 Apr 2010, Xiaotian Feng wrote:
>
>> 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.
>>
>> Signed-off-by: Xiaotian Feng <dfeng@redhat.com>
>> Cc: Pekka Enberg <penberg@cs.helsinki.fi>
>> Cc: Matt Mackall <mpm@selenic.com>
>> Cc: David Rientjes <rientjes@google.com>
>
> Acked-by: David Rientjes <rientjes@google.com>
>
>> Cc: Ingo Molnar <mingo@elte.hu>
>> Cc: Vegard Nossum <vegard.nossum@gmail.com>
>> ---
>> mm/slub.c | 11 +++++++++--
>> 1 files changed, 9 insertions(+), 2 deletions(-)
>>
>> diff --git a/mm/slub.c b/mm/slub.c
>> index b364844..a3a5a18 100644
>> --- a/mm/slub.c
>> +++ b/mm/slub.c
>> @@ -3335,8 +3335,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);
>>
Applied, thanks!
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-04-11 6:40 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-08 9:26 [PATCH] slub: __kmalloc_node_track_caller should trace kmalloc_large_node case Xiaotian Feng
2010-04-08 19:03 ` David Rientjes
2010-04-11 6:40 ` Pekka Enberg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).