From: Mike Snitzer <snitzer@kernel.org>
To: Jeff Layton <jlayton@kernel.org>
Cc: Chuck Lever <cel@kernel.org>,
linux-nfs@vger.kernel.org, NeilBrown <neil@brown.name>,
Olga Kornievskaia <okorniev@redhat.com>,
Dai Ngo <Dai.Ngo@oracle.com>, Tom Talpey <tom@talpey.com>,
Christoph Hellwig <hch@lst.de>, Jens Axboe <axboe@kernel.dk>,
Matthew Wilcox <willy@infradead.org>,
Jonathan Corbet <corbet@lwn.net>,
linux-mm@kvack.org, linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH v8 0/7] mm, iomap, NFSD: stop uncached writes reading back shared pages
Date: Fri, 23 Oct 2026 10:12:07 -0400 [thread overview]
Message-ID: <attrN9__XXJNSfuW@kernel.org> (raw)
In-Reply-To: <9b43a1aec170ee810ef5fd2a2ab1288bad6508fd.camel@kernel.org>
On Fri, Oct 23, 2026 at 06:57:09AM -0400, Jeff Layton wrote:
>
> It might not hurt to have your LLM simplify the patch descriptions
> here. I find that my appetite for reading claude-ish walls of text has
> waned in recent weeks. This skill helps a lot:
>
> https://github.com/danyuchn/asd-ste100-skill
Thanks, I've now trained my claude monkey with it. But I'm sure it'll
still throw feces periodically.
Also, I've reviewed the sashiko review of this v8, that you kindly
forwarded this morning, and 3 of the 7 issues it flagged were real.
I don't want to spam the lists more than I already have by immediately
posting v9... but it has needed changes, blech. I'll at least wait to
see if Chuck picks up 1/7 to fold into the commit it fixes which is
already staged in cel/nfsd-testing (and if so I'll move Chuck and Jeff
to cc and upgrade -mm and -fsdevel to the To: for v9's posting...)
But here is the changelog for pending v9, in case it helps reviewers
side-step reporting something in v8 that is already addressed in v9:
Changes since v8, from the sashiko findings Jeff Layton relayed:
- 2/7 and 4/7: a folio is counted in WB_DONTCACHE_DIRTY only when both
PG_dirty and its dirty tag are set. v8 tested the tag alone.
__folio_cancel_dirty() clears PG_dirty but leaves the tag, so a
cancelled folio that stays cached kept a stale tag. 2/7 then
uncounted such a folio twice, and 4/7 counted it and never uncounted
it.
- 7/7: NFSD finds the edges a buffered segment shares by the mapping's
smallest folio, as iomap does, not by page. On 16 KiB blocks, a WRITE
written as one buffered segment can have page-aligned ends inside a
block. Nothing completed those edges, and the folios stayed cached
until reclaim. NFSD also completes a segment's first edge only when
the write reached the end of the segment's bytes in that unit. A
short write that stopped inside the unit had not written its part.
- 1/7 and 5/7: a paragraph each on a limit the review raised. 1/7
cannot keep a larger cached folio, left by readahead, from spanning
the cut. 5/7 marks the folio before iomap validates the iomap. A
stale iomap stopped by a fatal signal then leaves a mark on a folio
this write did not complete. Both cost one read-back and no data.
- 3/7 and 6/7: unchanged.
Longer form for the fixes that fell out from the v8 sashiko review:
2/7, the stale dirty tag: real. __folio_cancel_dirty() uncounts a
dropbehind folio and clears PG_dirty, but leaves PAGECACHE_TAG_DIRTY
set. Only writeback and truncation clear the tag, and writeback skips
a clean folio. So a cancelled folio that stays cached keeps a stale
tag, and my clear path uncounted it a second time. The same stale tag
made folio_mark_dropbehind() in 4/7 count a clean folio that nothing
would uncount. v9 tests PG_dirty as well as the tag in both places.
A folio is counted only when both are set. The race the tag closes
stays closed. A dirtier that has set PG_dirty but not yet counted the
folio has not set the tag either.
7/7, the PAGE_SIZE edge tests: real. On 16 KiB blocks, a WRITE written
as one buffered segment can have page-aligned ends inside a block.
iomap left those edges for NFSD to complete, and NFSD never asked about
them. Those folios stayed cached until reclaim. v9 finds the edges by the
mapping's smallest folio, as iomap does. Measured on the loop device,
whose dma_alignment of 511 makes every TCP payload memory-misaligned.
NFSD then writes each WRITE as one buffered segment. 32 writers of
12288-byte records: v8 left all 32,736 pages of a 128 MiB file
resident. v9 leaves 1,348 of 262,080 pages of a 1 GiB file, 0.5%.
7/7, the short write that completes the first edge: real, and the cost
is one read-back on the retry. v9 completes the first edge only when
the write reached the end of the segment's bytes in that unit.
prev parent reply other threads:[~2026-10-23 14:12 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-23 2:45 [PATCH v8 0/7] mm, iomap, NFSD: stop uncached writes reading back shared pages Mike Snitzer
2026-10-23 2:45 ` [PATCH v8 1/7] NFSD: cut a misaligned direct-mode WRITE at the mapping's smallest folio Mike Snitzer
2026-10-23 17:45 ` Chuck Lever
2026-10-24 1:11 ` Mike Snitzer
2026-10-23 2:45 ` [PATCH v8 2/7] mm: take a folio off WB_DONTCACHE_DIRTY only if it was counted there Mike Snitzer
2026-10-23 2:45 ` [PATCH v8 3/7] mm: expose WB_DONTCACHE_DIRTY in bdi debugfs stats Mike Snitzer
2026-10-23 2:45 ` [PATCH v8 4/7] mm: add folio_mark_dropbehind() to mark a folio dropbehind and account it Mike Snitzer
2026-10-23 2:45 ` [PATCH v8 5/7] mm, iomap: keep a partly covered page until an uncached write completes it Mike Snitzer
2026-10-23 2:45 ` [PATCH v8 6/7] mm, iomap: let an uncached writer complete its shared pages itself Mike Snitzer
2026-10-23 2:45 ` [PATCH v8 7/7] NFSD: drop a shared boundary page only once both WRITEs have written it Mike Snitzer
2026-10-23 10:57 ` [PATCH v8 0/7] mm, iomap, NFSD: stop uncached writes reading back shared pages Jeff Layton
2026-10-23 14:12 ` Mike Snitzer [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=attrN9__XXJNSfuW@kernel.org \
--to=snitzer@kernel.org \
--cc=Dai.Ngo@oracle.com \
--cc=axboe@kernel.dk \
--cc=cel@kernel.org \
--cc=corbet@lwn.net \
--cc=hch@lst.de \
--cc=jlayton@kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-nfs@vger.kernel.org \
--cc=neil@brown.name \
--cc=okorniev@redhat.com \
--cc=tom@talpey.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox