From: Lance Yang <lance.yang@linux.dev>
To: Breno Leitao <leitao@debian.org>
Cc: catalin.marinas@arm.com, akpm@linux-foundation.org,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
kernel-team@meta.com, sj@kernel.org
Subject: Re: [PATCH RFC] mm/kmemleak: avoid soft lockup when scanning task stacks
Date: Fri, 12 Jun 2026 19:22:38 +0800 [thread overview]
Message-ID: <086712c1-18bc-414a-9a7a-723b9498847a@linux.dev> (raw)
In-Reply-To: <aivhX7RtLVwBkNj6@gmail.com>
On 2026/6/12 18:39, Breno Leitao wrote:
> On Fri, Jun 12, 2026 at 05:57:12PM +0800, Lance Yang wrote:
>
>>> If we go this route, the aborted round has to suppress reporting, reusing
>>> kmemleak's existing "scan was interrupted -> don't report" path:
>>>
>>> if (need_resched() && !kmemleak_stack_scan_break(g, p)) {
>>> aborted = true;
>>> goto unlock;
>>> }
>>
>> I'd expect the normal case to just drop RCU, cond_resched(), take RCU
>> again, see both cursors still alive, and keep walking :)
>>
>>> ...
>>> if (scan_should_stop() || aborted)
>>> return;
>>
>> And yeah, you're right. If we do lost a cursor, bailing out and
>> skipping reporting fot that incomplete root scan should be the
>> right thing, I guess :D
>
> Thanks! Under what circumstances would the cursor actually be lost?
It should be race, but possible, that we happen to stop on g/p,
drop RCU, and one of them is gone by the time we come back.
next prev parent reply other threads:[~2026-06-12 11:22 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-11 12:45 Breno Leitao
2026-06-12 1:10 ` SeongJae Park
2026-06-12 9:42 ` Breno Leitao
2026-06-12 3:16 ` Lance Yang
2026-06-12 4:27 ` Lance Yang
2026-06-12 9:09 ` Breno Leitao
2026-06-12 9:57 ` Lance Yang
2026-06-12 10:39 ` Breno Leitao
2026-06-12 11:22 ` Lance Yang [this message]
2026-06-12 11:57 ` 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=086712c1-18bc-414a-9a7a-723b9498847a@linux.dev \
--to=lance.yang@linux.dev \
--cc=akpm@linux-foundation.org \
--cc=catalin.marinas@arm.com \
--cc=kernel-team@meta.com \
--cc=leitao@debian.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=sj@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
all inboxes | Powered by JetHome®