From: Matthew Wilcox <willy@infradead.org>
To: Zi Yan <ziy@nvidia.com>
Cc: Gregg Leventhal <gleventhal@janestreet.com>,
"To: Alexander Viro" <viro@zeniv.linux.org.uk>,
Christian Brauner <brauner@kernel.org>,
"Cc: Jan Kara" <jack@suse.cz>,
Andrew Morton <akpm@linux-foundation.org>,
Song Liu <song@kernel.org>,
linux-fsdevel@vger.kernel.org, linux-mm@kvack.org,
linux-kernel@vger.kernel.org,
Eric Hagberg <ehagberg@janestreet.com>
Subject: Re: Subject: [BUG/RFC] write-open file THP cache purge can discard dirty page cache
Date: Tue, 30 Jun 2026 20:07:12 +0100 [thread overview]
Message-ID: <akQT4G4RpxPPMb2Q@casper.infradead.org> (raw)
In-Reply-To: <DJMM9V4Z58QP.2DXAKKZ4YE6HA@nvidia.com>
On Tue, Jun 30, 2026 at 03:05:16PM -0400, Zi Yan wrote:
> On Tue Jun 30, 2026 at 2:36 PM EDT, Matthew Wilcox wrote:
> > On Tue, Jun 30, 2026 at 01:01:53PM -0400, Gregg Leventhal wrote:
> >> On an affected 6.12 kernel with CONFIG_READ_ONLY_THP_FOR_FS=y, a file can
> >> contain read-only file THPs installed by khugepaged / MADV_COLLAPSE. When that
> >> same file is later opened for write, do_dentry_open() notices
> >> filemap_nr_thps() and drops the page cache:
> > [...]
> >>
> >> This is unsafe if the mapping also contains dirty folios.
> >
> > But there shouldn't be any. It should not be possible to have
> > dirty folios and THPs in the same file unless the filesystem
> > supports large folios natively.
> >
> > If the file is open for writing, the attempt to create THPs should fail.
>
> Maybe he means order-0 dirty folios?
Even then. They're all supposed to be gone. I don't want to guarantee
that the filesystem will properly skip over clean folios during
writeback.
prev parent reply other threads:[~2026-06-30 19:07 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-30 17:01 Subject: [BUG/RFC] write-open file THP cache purge can discard dirty page cache Gregg Leventhal
2026-06-30 17:18 ` Gregg Leventhal
2026-06-30 18:31 ` Pedro Falcato
2026-06-30 18:49 ` Pedro Falcato
2026-06-30 19:55 ` Pedro Falcato
2026-06-30 22:34 ` Matthew Wilcox
2026-06-30 22:48 ` Zi Yan
2026-07-01 12:05 ` Pedro Falcato
2026-07-01 11:54 ` Matthew Wilcox
2026-07-01 12:04 ` Pedro Falcato
2026-07-01 12:48 ` Pedro Falcato
2026-07-01 13:07 ` Gregg Leventhal
2026-07-01 14:23 ` Pedro Falcato
2026-06-30 18:36 ` Matthew Wilcox
2026-06-30 19:05 ` Zi Yan
2026-06-30 19:07 ` Matthew Wilcox [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=akQT4G4RpxPPMb2Q@casper.infradead.org \
--to=willy@infradead.org \
--cc=akpm@linux-foundation.org \
--cc=brauner@kernel.org \
--cc=ehagberg@janestreet.com \
--cc=gleventhal@janestreet.com \
--cc=jack@suse.cz \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=song@kernel.org \
--cc=viro@zeniv.linux.org.uk \
--cc=ziy@nvidia.com \
/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