mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Vlastimil Babka (SUSE)" <vbabka@kernel.org>
To: Hao Li <hao.li@linux.dev>, harry@kernel.org, akpm@linux-foundation.org
Cc: cl@gentwo.org, rientjes@google.com, roman.gushchin@linux.dev,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] slub: avoid duplicate trace_kmalloc() in __do_kmalloc_node()
Date: Fri, 4 Dec 2026 10:39:38 +0100	[thread overview]
Message-ID: <61f7fd6c-1799-4bac-9a56-40197bacd376@kernel.org> (raw)
In-Reply-To: <20261204042323.94164-1-hao.li@linux.dev>

On 12/4/26 05:18, Hao Li wrote:
> 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()")

Closes: https://sashiko.dev/#/bug/linux-a862b54f-88e8-4e5f-b187-67f23315c7ca

I know you found the problem independently before that bug was assigned to
us, so just to complete the metadata.

> Signed-off-by: Hao Li <hao.li@linux.dev>

Reviewed-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>

Thanks!

> ---
>  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;


  reply	other threads:[~2026-12-04  9:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-04  4:18 Hao Li
2026-12-04  9:39 ` Vlastimil Babka (SUSE) [this message]
2026-12-04 14:15   ` Harry Yoo
2026-12-04 14:47 ` Harry Yoo (Meta)
2026-12-04 14:50 ` Sang-Heon Jeon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=61f7fd6c-1799-4bac-9a56-40197bacd376@kernel.org \
    --to=vbabka@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=cl@gentwo.org \
    --cc=hao.li@linux.dev \
    --cc=harry@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=rientjes@google.com \
    --cc=roman.gushchin@linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®