All of lore.kernel.org
 help / color / mirror / Atom feed
From: Catalin Marinas <catalin.marinas@arm.com>
To: Breno Leitao <leitao@debian.org>
Cc: Matthew Wilcox <willy@infradead.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	mm-commits@vger.kernel.org, kent.overstreet@linux.dev,
	bigeasy@linutronix.de, arnd@arndb.de
Subject: Re: + radix-tree-fix-kmemleak-false-positives-on-tree-head-reassignment.patch added to mm-new branch
Date: Mon, 6 Jul 2026 12:39:30 +0100	[thread overview]
Message-ID: <akuT8pEjBKvByPlA@arm.com> (raw)
In-Reply-To: <akuFSv7JaXo6M8gx@gmail.com>

On Mon, Jul 06, 2026 at 03:41:54AM -0700, Breno Leitao wrote:
> On Sun, Jul 05, 2026 at 11:45:04AM +0100, Matthew Wilcox wrote:
> > > Add a matching kmemleak_transient_leak() stub to the radix tree test
> > > harness so the userspace lib/radix-tree.c build keeps building.
> >
> > Last time this was proposed, the suggestion was that kmemleak needed to
> > be fixed.
> >
> > https://lore.kernel.org/all/aCyI8T2sWlPLEYZ_@arm.com/
> 
> My understanding from that thread is that kmemleak could be made more
> reliable by explicitly waiting for a rescan before reporting (which it
> is a great addition).
> 
> This patch explictly tell kmemleak that this object will be temporarily
> unreferenced, which is more cooperative.
> 
> That said, I believe both approaches. This transient-leak annotation and
> Catalin's earlier proposal—can coexist as complementary mechanisms to
> reduce kmemleak false positives (which has been my goal, given I run
> kmemleak-enabled kernel at some scale)

I'm not happy with the transient leak annotations either but couldn't
come up with something better. The last year's proposal to reset the
checksum pretty much forces it to go through one more scan, something
your patches already do, though maybe we could change the default.

I wonder whether we should force the scanning to happen twice in a row
and drop the min_unref_count. Those transient leaks happen because of
some micro/milliseconds miss of a pointer. If we have new white objects
of the end of a scan, go one more round through the root and gray
objects (but do not reset them to white) and only then report the leaks.
If the white objects have been reported already or we don't have any
left, skip this additional scan or bail out early. We could have a
tunable for this one to go 2-3 times if needed, though I guess twice is
sufficient. The interface is also preserved as you do an echo scan only
once (or twice initially with the checksum calculation).

-- 
Catalin

  reply	other threads:[~2026-07-06 11:39 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-05  2:12 + radix-tree-fix-kmemleak-false-positives-on-tree-head-reassignment.patch added to mm-new branch Andrew Morton
2026-07-05 10:45 ` Matthew Wilcox
2026-07-05 18:15   ` Andrew Morton
2026-07-06 10:41   ` Breno Leitao
2026-07-06 11:39     ` Catalin Marinas [this message]
2026-07-06 14:53       ` Breno Leitao
2026-07-06 16:25         ` Catalin Marinas
2026-07-06 23:19           ` Catalin Marinas
2026-07-07 11:26             ` Breno Leitao
2026-07-07 14:01               ` Catalin Marinas
  -- strict thread matches above, loose matches on Subject: below --
2026-07-05  2:11 Andrew Morton
2026-07-02 22:42 Andrew Morton
2026-07-03 15:26 ` Breno Leitao

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=akuT8pEjBKvByPlA@arm.com \
    --to=catalin.marinas@arm.com \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@arndb.de \
    --cc=bigeasy@linutronix.de \
    --cc=kent.overstreet@linux.dev \
    --cc=leitao@debian.org \
    --cc=mm-commits@vger.kernel.org \
    --cc=willy@infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.