Re: [PATCH v2] mm: filemap: retain mapped dropbehind folios

From: Tal Zussman

Date: Sat Aug 29 2026 - 11:54:00 EST


On Sat, 29 Aug 2026 20:30:47 +0800, Wenjie Qi <qwjhust@xxxxxxxxx> wrote:
> Fault-around can map ready dropbehind folios without going through the
> normal page-cache lookup that clears dropbehind. A mapping represents a
> competing cached user, so retain the folio instead of forcibly unmapping it
> when writeback completes.
>
> Unmapped dropbehind folios continue through the existing invalidation path.
>
> Signed-off-by: Wenjie Qi <qiwenjie@xxxxxxxxxx>

Overall looks good to me. It may be nice to add a sentence about the
safety aspect of this in the commit message. Maybe something like:

folio_unmap_invalidate() may sleep if the folio is mapped, so this
also ensures that folio_end_dropbehind() is safe to call from
non-preemptible task context.

Reviewed-by: Tal Zussman <tz2294@xxxxxxxxxxxx>

--
Tal Zussman <tz2294@xxxxxxxxxxxx>