Linux-mm Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] slub: avoid duplicate trace_kmalloc() in __do_kmalloc_node()
@ 2026-12-04  4:18 Hao Li
  2026-12-04  9:39 ` Vlastimil Babka (SUSE)
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Hao Li @ 2026-12-04  4:18 UTC (permalink / raw)
  To: vbabka, harry, akpm
  Cc: cl, rientjes, roman.gushchin, linux-mm, linux-kernel, Hao Li

The call path __do_kmalloc_node() -> __kmalloc_large_node_noprof()
results in duplicate trace_kmalloc() calls.

Since __kmalloc_large_node_noprof() is a thin wrapper around
___kmalloc_large_node(), call ___kmalloc_large_node() directly instead.
This skips the trace_kmalloc() in __kmalloc_large_node_noprof() and
eliminates the duplication.

Fixes: a0a44d9175b3 ("mm, slab: don't wrap internal functions with alloc_hooks()")
Signed-off-by: Hao Li <hao.li@linux.dev>
---
 mm/slub.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/slub.c b/mm/slub.c
index 5c33d1247060..5399f636be9f 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -5516,7 +5516,7 @@ void *__do_kmalloc_node(kmem_buckets *b, gfp_t flags, int node,
 	void *ret;
 
 	if (unlikely(size > KMALLOC_MAX_CACHE_SIZE)) {
-		ret = __kmalloc_large_node_noprof(size, flags, node);
+		ret = ___kmalloc_large_node(size, flags, node);
 		trace_kmalloc(ac->caller_addr, ret, size,
 			      PAGE_SIZE << get_order(size), flags, node);
 		return ret;
-- 
2.56.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-12-04 14:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-04  4:18 [PATCH] slub: avoid duplicate trace_kmalloc() in __do_kmalloc_node() Hao Li
2026-12-04  9:39 ` Vlastimil Babka (SUSE)
2026-12-04 14:15   ` Harry Yoo
2026-12-04 14:47 ` Harry Yoo (Meta)
2026-12-04 14:50 ` Sang-Heon Jeon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox