linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Tytus Rogalewski <tytanick@gmail.com>
To: Harry Yoo <harry.yoo@oracle.com>
Cc: "Darrick J. Wong" <djwong@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	 Vlastimil Babka <vbabka@suse.cz>,
	"Liam R . Howlett" <Liam.Howlett@oracle.com>,
	 Christoph Lameter <cl@gentwo.org>,
	David Rientjes <rientjes@google.com>,
	 Roman Gushchin <roman.gushchin@linux.dev>,
	linux-mm@kvack.org
Subject: Re: [PATCH V1] mm/slub: fix memory leak in free_to_pcs_bulk()
Date: Thu, 13 Nov 2025 18:02:17 +0100	[thread overview]
Message-ID: <CANfXJzsha8NtY6SwVzq=w1fNYSF46x3yeGk-ZuGCUj7CGrn5nw@mail.gmail.com> (raw)
In-Reply-To: <aRUpqFS8pU0qGIsb@hyeyoo>

[-- Attachment #1: Type: text/plain, Size: 1796 bytes --]

Hi,
OK it seems that this in deed fixed the issue, and i do not see leak now.
Thanks for fixing it :)
Btw if you guys need VPS with GPU resources, i can give you free ride on
SimplePod.ai for helping fixing that issue :)




--

tel. 790 202 300

*Tytus Rogalewski*

Dolina Krzemowa 6A

83-010 Jagatowo

NIP: 9570976234


czw., 13 lis 2025 o 01:43 Harry Yoo <harry.yoo@oracle.com> napisał(a):

> On Wed, Nov 12, 2025 at 10:46:45AM -0800, Darrick J. Wong wrote:
> > On Tue, Nov 11, 2025 at 09:53:31PM +0900, Harry Yoo wrote:
> > > The commit 989b09b73978 ("slab: skip percpu sheaves for remote object
> > > freeing") introduced the remote_objects array in free_to_pcs_bulk() to
> > > skip sheaves when objects from a remote node are freed.
> > >
> > > However, the array is flushed only when:
> > >   1) the array becomes full (++remote_nr >= PCS_BATCH_MAX), or
> > >   2) slab_free_hook() returns false and size becomes zero.
> > >
> > > When neither of the conditions is met, objects in the array are leaked.
> > > This resulted in a memory leak [1], where 82 GiB of memory was
> allocated
> > > for the maple_node cache.
> > >
> > > Flush the array after successfully freeing objects to sheaves
> > > in the do_free: path.
> > >
> > > In the meantime, move the snippet if (!size) goto flush_remote; outside
> > > the while loop for readability. Let's say all objects in the array are
> > > from a remote node: then we acquire s->cpu_sheaves->lock and try to
> free
> > > an object even when size is zero. This doesn't appear to be harmful,
> > > but isn't really readable.
> >
> > I'll put this on my test fleet this evening.  Thank you for the quick
> > fix! :)
>
> Thanks for testing, Darrick!
>
> --
> Cheers,
> Harry / Hyeonggon
>

[-- Attachment #2: Type: text/html, Size: 3492 bytes --]

  parent reply	other threads:[~2025-11-13 17:02 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-11 12:53 Harry Yoo
2025-11-11 13:13 ` Vlastimil Babka
2025-11-11 15:37 ` Liam R. Howlett
2025-11-11 16:48   ` Tytus Rogalewski
2025-11-11 18:26     ` Harry Yoo
2025-11-12 14:47       ` Tytus Rogalewski
2025-11-13  0:42         ` Harry Yoo
2025-11-12 18:46 ` Darrick J. Wong
2025-11-13  0:43   ` Harry Yoo
2025-11-13 17:01     ` Darrick J. Wong
2025-11-13 17:02     ` Tytus Rogalewski [this message]
2025-11-13 17:10       ` Vlastimil Babka

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='CANfXJzsha8NtY6SwVzq=w1fNYSF46x3yeGk-ZuGCUj7CGrn5nw@mail.gmail.com' \
    --to=tytanick@gmail.com \
    --cc=Liam.Howlett@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=cl@gentwo.org \
    --cc=djwong@kernel.org \
    --cc=harry.yoo@oracle.com \
    --cc=linux-mm@kvack.org \
    --cc=rientjes@google.com \
    --cc=roman.gushchin@linux.dev \
    --cc=vbabka@suse.cz \
    /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