From: Breno Leitao <leitao@debian.org>
To: Catalin Marinas <catalin.marinas@arm.com>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH] mm: kmemleak: confirm suspected leaks with a second scan
Date: Fri, 10 Jul 2026 01:51:40 -0700 [thread overview]
Message-ID: <alCxkNBvoDGRG2ee@gmail.com> (raw)
In-Reply-To: <20260709173347.689607-1-catalin.marinas@arm.com>
On Thu, Jul 09, 2026 at 06:24:47PM +0100, Catalin Marinas wrote:
> The kmemleak marking phase is not atomic. While the object graph is
> traversed, the kernel can modify pointers, free objects or allocate new
> ones. If a reference to an object is moved from one location to another,
> kmemleak scanning may miss it. We have explicit annotations like
> kmemleak_transient_leak() but identifying and maintaining them is not
> trivial.
>
> Given that such transient leaks are short-lived, rather than just
> reporting such objects as leaks, do another scan to confirm the
> suspected objects. If no new leaks are found during the first scan, skip
> the confirmation one.
>
> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
> Assisted-by: Claude:claude-opus-4-8
> Cc: Breno Leitao <leitao@debian.org>
> Cc: Andrew Morton <akpm@linux-foundation.org>
Tested-by: Breno Leitao <leitao@debian.org>
Reviewed-by: Breno Leitao <leitao@debian.org>
PS: This is now conflicting with commit 946935b07cc94 ("mm/kmemleak:
skip the remaining scan phases when interrupted"), which has just showed
up in linux-next. So, a respin might be required.
> BTW, I'll be away from Saturday for three weeks. I may reply
> occasionally but won't be able to test anything.
Let me know if you want me to respin it based on linux-next.
BTW: Really thanks for doing it. I will backport it to Meta's kernel to
pressure-test it and keep an eye on false positives.
--breno
prev parent reply other threads:[~2026-07-10 8:51 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-09 17:24 [PATCH] mm: kmemleak: confirm suspected leaks with a second scan Catalin Marinas
2026-07-10 3:13 ` Andrew Morton
2026-07-10 8:51 ` Breno Leitao [this message]
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=alCxkNBvoDGRG2ee@gmail.com \
--to=leitao@debian.org \
--cc=akpm@linux-foundation.org \
--cc=catalin.marinas@arm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.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