From: Wenjie Qi <qwjhust@gmail.com>
To: baohua@kernel.org
Cc: willy@infradead.org, jack@suse.cz, akpm@linux-foundation.org,
linux-fsdevel@vger.kernel.org, linux-mm@kvack.org,
linux-kernel@vger.kernel.org, stable@vger.kernel.org,
axboe@kernel.dk, trond.myklebust@hammerspace.com,
tz2294@columbia.edu, jaegeuk@kernel.org, chao@kernel.org,
qiwenjie@xiaomi.com, qwjhust@gmail.com
Subject: Re: [PATCH v4] mm: filemap: retain mapped dropbehind folios
Date: Sun, 30 Aug 2026 17:13:43 +0800 [thread overview]
Message-ID: <20260830165401.1788080041-1-qwjhust@gmail.com> (raw)
In-Reply-To: <CAGsJ_4wpUBOXKd8aGNz76U+87bwDUXZZFSW2UhNcq4qpjVvggQ@mail.gmail.com>
Yes. The current path removes the folio from the page cache, so a later
mmap access can incur both another fault and I/O. I should have stated
that explicitly.
For fault-around neighbors, folio_mapped() cannot distinguish the faulting
page from a speculative neighbor. This patch takes the conservative policy
that an installed PTE represents a competing cache user and wins over the
writer's RWF_DONTCACHE hint. It can therefore retain a speculative neighbor
which is never accessed. Distinguishing those cases seems to require
fault-around to preserve the faulting folio while not mapping, or later
dropping, dropbehind neighbors. I think that should be considered as a
separate follow-up.
For folio_launder(), filemap_end_dropbehind() holds the folio lock and returns
if the folio is dirty or under writeback before calling
folio_unmap_invalidate(). folio_launder() also immediately returns for a
clean folio. I do not see how nfs_launder_folio() is reached from this
completion path unless the locked, unmapped folio can become dirty between
those checks. Is there a path I am missing?
next prev parent reply other threads:[~2026-08-30 9:13 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-20 14:29 [PATCH] mm: filemap: tighten dropbehind completion context check Wenjie Qi
2026-08-20 14:34 ` Matthew Wilcox
2026-08-21 1:23 ` Wenjie Qi
2026-08-21 3:30 ` Matthew Wilcox
2026-08-24 13:34 ` Wenjie Qi
2026-08-29 1:10 ` Andrew Morton
2026-08-29 12:13 ` Wenjie Qi
2026-08-30 8:45 ` Barry Song
2026-08-29 12:30 ` [PATCH v2] mm: filemap: retain mapped dropbehind folios Wenjie Qi
2026-08-29 14:47 ` Matthew Wilcox
2026-08-29 15:53 ` Tal Zussman
2026-08-29 16:09 ` Tal Zussman
2026-08-29 17:36 ` [PATCH v3] " Wenjie Qi
2026-08-29 18:16 ` Andrew Morton
2026-08-30 3:25 ` [PATCH v4] " Wenjie Qi
2026-08-30 8:35 ` Barry Song
2026-08-30 9:13 ` Wenjie Qi [this message]
2026-08-30 9:31 ` Barry Song
2026-08-30 11:58 ` Tal Zussman
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=20260830165401.1788080041-1-qwjhust@gmail.com \
--to=qwjhust@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=axboe@kernel.dk \
--cc=baohua@kernel.org \
--cc=chao@kernel.org \
--cc=jack@suse.cz \
--cc=jaegeuk@kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=qiwenjie@xiaomi.com \
--cc=stable@vger.kernel.org \
--cc=trond.myklebust@hammerspace.com \
--cc=tz2294@columbia.edu \
--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
all inboxes | Powered by JetHome®