From: Gregory Price <gourry@gourry.net>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
kernel-team@meta.com, liam@infradead.org, ljs@kernel.org,
david@kernel.org, vbabka@kernel.org, jannh@google.com,
wangjiexun@tinylab.org, sashiko-bot <sashiko-bot@kernel.org>,
stable@vger.kernel.org
Subject: Re: [PATCH] mm/madvise: reclaim isolated folios if PTE restart fails
Date: Tue, 15 Sep 2026 10:13:24 -0400 [thread overview]
Message-ID: <aqlRJbY5mlmjhEzj@gourry-fedora-PF4VCD3F> (raw)
In-Reply-To: <20260914233209.3fd5a6e848ee82d13e43a301@linux-foundation.org>
On Mon, Sep 14, 2026 at 11:32:09PM -0700, Andrew Morton wrote:
> On Sat, 12 Sep 2026 07:08:32 -0400 Gregory Price <gourry@gourry.net> wrote:
>
> > MADV_PAGEOUT collects isolated folios on a local list before reclaiming
> > them after the PTE walk. The reschedule path drops the PTE lock and then
> > restarts the mapping with pte_offset_map_lock().
> >
> > A concurrent operation can remove or replace the PTE table while the lock
> > is dropped, causing pte_offset_map_lock() to return NULL. Returning directly
> > in that case bypasses reclaim_pages(), leaving the collected folios off the
> > LRU with elevated references.
>
> aw man, you got so close then left us hanging.
>
> So what happened next? Machine crashed? Permanent leak?
>
Permanent leak.
nr_isolated_anon increases reliably and does not decrease when the
process dies.
> >
> > Fixes: b2f557a21bc8 ("mm/madvise: add cond_resched() in madvise_cold_or_pageout_pte_range()")
> > Reported-by: sashiko-bot <sashiko-bot@kernel.org>
> > Closes: https://sashiko.dev/#/patchset/20260821150912.183976-1-gourry@gourry.net
> > Cc: <stable@vger.kernel.org>
>
> #include "Documentation/process/stable-kernel-rules.rst"
>
> (sorry, getting snarky. I'm saying this stuff 100x/day at present and
> it just isn't sticking).
>
> > Assisted-by: LLM
>
> Can I suggest you update LLM's prompts so it checks that the changelog
> includes userspace-visible runtime effects and so that it checks that
> the patch is approximately compliant with stable-kernel-rules?
>
> If you do, please share that prompt with me and I'll put it in ~/.signature
>
I typically (re)write (or at least heavily edit) the messages to ensure I
actually understand what's going on. I'll update my brainmeats.
I get it though, rather than permanent leak say how to observe said leak
(vmstat or etc). ack :]
~Gregory
next prev parent reply other threads:[~2026-09-15 14:13 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-12 11:08 Gregory Price
2026-09-15 6:32 ` Andrew Morton
2026-09-15 14:13 ` Gregory Price [this message]
2026-09-15 15:55 ` Lorenzo Stoakes (ARM)
2026-09-15 17:00 ` Gregory Price
2026-09-16 13:18 ` Lorenzo Stoakes (ARM)
2026-09-16 14:02 ` Gregory Price
2026-09-16 14:08 ` Lorenzo Stoakes (ARM)
2026-09-15 17:12 ` Gregory Price
2026-09-16 13:03 ` Lorenzo Stoakes (ARM)
2026-09-16 13:57 ` Gregory Price
2026-09-16 14:12 ` Lorenzo Stoakes (ARM)
2026-09-16 14:42 ` Gregory Price
2026-09-16 14:48 ` David Hildenbrand (Arm)
2026-09-16 14:58 ` Gregory Price
2026-09-16 14:59 ` David Hildenbrand (Arm)
2026-09-16 15:19 ` Gregory Price
2026-09-16 15:21 ` Lorenzo Stoakes (ARM)
2026-09-16 15:24 ` David Hildenbrand (Arm)
2026-09-16 15:37 ` Gregory Price
2026-09-16 15:42 ` David Hildenbrand (Arm)
2026-09-16 16:10 ` Gregory Price
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=aqlRJbY5mlmjhEzj@gourry-fedora-PF4VCD3F \
--to=gourry@gourry.net \
--cc=akpm@linux-foundation.org \
--cc=david@kernel.org \
--cc=jannh@google.com \
--cc=kernel-team@meta.com \
--cc=liam@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=ljs@kernel.org \
--cc=sashiko-bot@kernel.org \
--cc=stable@vger.kernel.org \
--cc=vbabka@kernel.org \
--cc=wangjiexun@tinylab.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®