From: Mike Snitzer <snitzer@kernel.org>
To: sashiko-reviews@lists.linux.dev,
Matthew Wilcox <willy@infradead.org>,
linux-mm@kvack.org
Cc: Chuck Lever <cel@kernel.org>, Jeff Layton <jlayton@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>,
Jonathan Corbet <corbet@lwn.net>,
Anna Schumaker <anna@kernel.org>
Subject: Re: [PATCH v9 3/6] mm: add folio_mark_dropbehind() to mark a folio dropbehind and account it
Date: Mon, 26 Oct 2026 02:42:44 -0400 [thread overview]
Message-ID: <at72ZLeWWQyptVq0@kernel.org> (raw)
In-Reply-To: <sashiko-outbox-184464@kernel.org>
On Sun, Oct 25, 2026 at 10:12:09PM +0000, sashiko-bot@kernel.org wrote:
> Can WB_DONTCACHE_DIRTY still be double-counted here if a stale
> PAGECACHE_TAG_DIRTY coincides with an unlocked dirtier that has just set
> PG_dirty?
Yes, in that window. The folio must be clean with a stale dirty tag.
On XFS that happens when iomap_writeback_handle_eof() skips a folio that
a truncate put beyond EOF. Then an unlocked dirtier sets PG_dirty, and
folio_mark_dropbehind() or filemap_clear_dropbehind() runs on that folio
before the dirtier takes the i_pages lock. In that gap, a counted folio
and an uncounted one look the same: PG_dirty and the dirty tag are both
set. Closing it needs a new page flag, or a tag clear in the paths that
uncount a folio. Both are core mm changes.
Only the counter changes. WB_DONTCACHE_DIRTY tells
wb_check_start_dontcache() how many pages the DONTCACHE writeback kick
writes. A count that is too high makes the kick write more dirty pages.
A count below zero makes it write none. Data and page state do not
change. Before 1/6, the clear in __filemap_get_folio_mpol() decided by
PG_dirty alone, so this window and a wider one were already there.
I do not plan to change this in this series. If linux-mm wants it
closed, I can follow up with whichever of the two changes linux-mm
prefers.
next prev parent reply other threads:[~2026-10-26 6:42 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-24 22:11 [PATCH v9 0/6] mm, iomap, NFSD: stop uncached writes reading back shared pages Mike Snitzer
2026-10-24 22:11 ` [PATCH v9 1/6] mm: take a folio off WB_DONTCACHE_DIRTY only if it was counted there Mike Snitzer
2026-10-24 22:11 ` [PATCH v9 2/6] mm: expose WB_DONTCACHE_DIRTY in bdi debugfs stats Mike Snitzer
2026-10-24 22:11 ` [PATCH v9 3/6] mm: add folio_mark_dropbehind() to mark a folio dropbehind and account it Mike Snitzer
2026-10-25 22:12 ` sashiko-bot
2026-10-26 6:42 ` Mike Snitzer [this message]
2026-10-24 22:11 ` [PATCH v9 4/6] mm, iomap: keep a partly covered page until an uncached write completes it Mike Snitzer
2026-10-24 22:11 ` [PATCH v9 5/6] mm, iomap: let an uncached writer complete its shared pages itself Mike Snitzer
2026-10-24 22:11 ` [PATCH v9 6/6] NFSD: drop a shared boundary page only once both WRITEs have written it Mike Snitzer
2026-10-25 22:12 ` sashiko-bot
2026-10-26 6:45 ` Mike Snitzer
2026-10-27 14:31 ` [PATCH v9 0/6] mm, iomap, NFSD: stop uncached writes reading back shared pages Jeff Layton
2026-10-27 15:36 ` Chuck Lever
2026-10-28 5:12 ` Mike Snitzer
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=at72ZLeWWQyptVq0@kernel.org \
--to=snitzer@kernel.org \
--cc=Dai.Ngo@oracle.com \
--cc=anna@kernel.org \
--cc=axboe@kernel.dk \
--cc=cel@kernel.org \
--cc=corbet@lwn.net \
--cc=hch@lst.de \
--cc=jlayton@kernel.org \
--cc=linux-mm@kvack.org \
--cc=neil@brown.name \
--cc=okorniev@redhat.com \
--cc=sashiko-reviews@lists.linux.dev \
--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