From: Gregory Price <gourry@gourry.net>
To: Matthew Wilcox <willy@infradead.org>
Cc: "Lorenzo Stoakes (ARM)" <ljs@kernel.org>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
kernel-team@meta.com, akpm@linux-foundation.org,
liam@infradead.org, david@kernel.org, vbabka@kernel.org,
jannh@google.com, sashiko-bot <sashiko-bot@kernel.org>
Subject: Re: [PATCH] mm/madvise: use folio_trylock() in the cold/pageout PMD split
Date: Fri, 21 Aug 2026 16:38:55 -0400 [thread overview]
Message-ID: <aoi2pQecMUndgFzo@gourry-fedora-PF4VCD3F> (raw)
In-Reply-To: <aoirfBmxkQA-HwJ_@casper.infradead.org>
On Fri, Aug 21, 2026 at 08:48:12PM +0100, Matthew Wilcox wrote:
> On Fri, Aug 21, 2026 at 07:23:34PM +0100, Lorenzo Stoakes (ARM) wrote:
>
> For the task running on CPU 1, yes. But the folio does get split rather
> than probably both failing.
>
Which, thinking about it, this patch actually solves non-spurious
(but exceedingly rare) failures as well, since prior both CPU0 and CPU1
can fail. After this patch, one of them is guaranteed to succeed.
The inflated failure count otherwise are the spurious ones.
> We couldn't quite make that work here since the whole point is to _never_
> get the refcount on the folio if somebody else has the lock, and once
> we've dropped the PTL, the folio might have been split and thus not be
> the folio we want any more (indeed it may have been freed, reallocated
> and now be a pointer to a tail page instead of a folio).
>
Makes me wonder how many more of these conditions are peppered around
THPs just eating cpu time.
~Gregory
prev parent reply other threads:[~2026-08-21 20:38 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-21 15:09 [PATCH] mm/madvise: use folio_trylock() in the cold/pageout PMD split Gregory Price
2026-08-21 18:23 ` Lorenzo Stoakes (ARM)
2026-08-21 18:42 ` Gregory Price
2026-08-21 19:18 ` Lorenzo Stoakes (ARM)
2026-08-21 19:48 ` Matthew Wilcox
2026-08-21 20:38 ` Gregory Price [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=aoi2pQecMUndgFzo@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=vbabka@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.