Re: [PATCH v3] mm: filemap: retain mapped dropbehind folios
From: Andrew Morton
Date: Sat Aug 29 2026 - 14:16:34 EST
On Sun, 30 Aug 2026 01:36:12 +0800 Wenjie Qi <qwjhust@xxxxxxxxx> wrote:
> From: Wenjie Qi <qiwenjie@xxxxxxxxxx>
>
> 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.
>
> For a mapped folio, folio_unmap_invalidate() can call
> unmap_mapping_folio(), which takes i_mmap_rwsem and may sleep. Retaining
> mapped folios avoids this path when folio_end_dropbehind() runs in
> non-preemptible task context.
>
> Unmapped dropbehind folios continue through the existing invalidation path.
Thanks.
When fixing a bug, please always provide a very clear description of the
userspace-visible runtime effects of that bug.
>From the above it appears that the current code can trigger a
sleeping-in-atomic warning? Has this been observed in any situation?
Is there a report?
chatgpt easily prepared a reproducer for me, which I haven't run.
If I'm correct in the above, we should backport this fix with a
cc:stable tag, do you agree?