[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <188efc4a8e37bc5dc64dd18989f9a254ef218449.camel@linaro.org>
Date: Fri, 01 Aug 2025 15:59:06 +0100
From: André Draszik <andre.draszik@...aro.org>
To: Thomas Gleixner <tglx@...utronix.de>, Sebastian Andrzej Siewior
<bigeasy@...utronix.de>, linux-kernel@...r.kernel.org
Cc: André Almeida <andrealmeid@...lia.com>, Darren Hart
<dvhart@...radead.org>, Davidlohr Bueso <dave@...olabs.net>, Ingo Molnar
<mingo@...hat.com>, Juri Lelli <juri.lelli@...hat.com>, Peter Zijlstra
<peterz@...radead.org>, Valentin Schneider <vschneid@...hat.com>, Waiman
Long <longman@...hat.com>, Andrew Morton <akpm@...ux-foundation.org>,
David Hildenbrand <david@...hat.com>, "Liam R. Howlett"
<Liam.Howlett@...cle.com>, Lorenzo Stoakes <lorenzo.stoakes@...cle.com>,
Michal Hocko <mhocko@...e.com>, Mike Rapoport <rppt@...nel.org>, Suren
Baghdasaryan <surenb@...gle.com>, Vlastimil Babka <vbabka@...e.cz>,
linux-mm@...ck.org
Subject: Re: [PATCH v2 2/6] futex: Use RCU-based per-CPU reference counting
instead of rcuref_t
On Wed, 2025-07-30 at 21:44 +0200, Thomas Gleixner wrote:
> On Wed, Jul 30 2025 at 13:20, André Draszik wrote:
> > kmemleak complains about a new memleak with this commit:
> >
> > [ 680.179004][ T101] kmemleak: 1 new suspected memory leaks (see /sys/kernel/debug/kmemleak)
> >
> > $ cat /sys/kernel/debug/kmemleak
> > unreferenced object (percpu) 0xc22ec0eface8 (size 4):
> > comm "swapper/0", pid 1, jiffies 4294893115
> > hex dump (first 4 bytes on cpu 7):
> > 01 00 00 00 ....
> > backtrace (crc b8bc6765):
> > kmemleak_alloc_percpu+0x48/0xb8
> > pcpu_alloc_noprof+0x6ac/0xb68
> > futex_mm_init+0x60/0xe0
> > mm_init+0x1e8/0x3c0
> > mm_alloc+0x5c/0x78
> > init_args+0x74/0x4b0
> > debug_vm_pgtable+0x60/0x2d8
> >
> > Reverting this commit (and patches 3 and 4 in this series due to context),
> > makes kmemleak happy again.
>
> Unsurprisingly ...
>
> debug_vm_pgtable() allocates it via mm_alloc() -> mm->init() and then
> after the selftest it invokes mmdrop(), which does not free it, as it is
> only freed in __mmput().
>
> The patch below should fix it.
It does. Thanks Thomas!
A.
Powered by blists - more mailing lists