Re: [PATCH] mm/shmem: don't drop a folio whose swap write failed
From: David Hildenbrand
Date: Tue Nov 24 2026 - 02:19:33 EST
On Mon, 23 Nov 2026 12:21:34 -0500, Mani Tofigh wrote:
> shmem_swapin_folio() drops a large folio that does not fit the mapping
> from the swap cache if the folio is neither dirty nor under writeback.
> The folio can belong to another file and be under swap writeback, when
> the swap entry was freed and reused before the swap cache lookup.
>
> Swap write completion does not take the folio lock. On a failed write,
> swap_write_end() marks the folio dirty and then ends writeback. Since
> dirty is tested first, the folio can look clean and written:
>
> [...]
Applied, thanks!
tree: mm/core.git
branch: for-next-fixes
Applied patches will appear soon in mm-next, followed by linux-next.
Please report any outstanding bugs that were missed during review, so we
can either drop the patch series or decide how to fix it up.
It is encouraged to provide Acked-bys, Reviewed-bys, and Tested-bys even
though the patches have already been applied. If possible, patch trailers
will be updated.
Note that commit hashes shown below are subject to change due to rebase,
trailer updates or similar. Further, this is not a guarantee that the
patches will go upstream. If in doubt, please check the listed branch.
[1/1] mm/shmem: don't drop a folio whose swap write failed
https://git.kernel.org/mm/core/c/e3464357
--
Cheers,
David