Linux-mm Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Harry Yoo <harry@kernel.org>
To: "Vlastimil Babka (SUSE)" <vbabka@kernel.org>
Cc: Hao Li <hao.li@linux.dev>,
	akpm@linux-foundation.org, 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 14:15:38 +0000	[thread overview]
Message-ID: <axK_39yW14OtEADn@thinkstation> (raw)
In-Reply-To: <61f7fd6c-1799-4bac-9a56-40197bacd376@kernel.org>

Thanks for catching and fixing this Hao!

On Fri, Dec 04, 2026 at 10:39:38AM +0100, Vlastimil Babka (SUSE) wrote:
> 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()")

I'd add Cc: stable as the patch is simple and it'll look like a memory
leak on some tools as allocation is counted twice and free is counted
only once.

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

I'll add it as I apply it, thanks.

-- 
Cheers,
Harry / Hyeonggon


  reply	other threads:[~2026-12-04 14:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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=axK_39yW14OtEADn@thinkstation \
    --to=harry@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=cl@gentwo.org \
    --cc=hao.li@linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=rientjes@google.com \
    --cc=roman.gushchin@linux.dev \
    --cc=vbabka@kernel.org \
    /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