Re: [PATCH RFC v2 0/7] mm: Fix MF_DELAYED handling on memory failure

Andrew Morton
2026-03-20T02:39:15Z

On Thu, 19 Mar 2026 23:30:27 +0000 Lisa Wang <wyihan@google.com> wrote:

> Here's a second revision to fix MF_DELAYED handling on memory failure.
>
> This patch series addresses an issue in the memory failure handling path
> where MF_DELAYED is incorrectly treated as an error. This issue was
> discovered while testing memory failure handling for guest_memfd.
>
> The proposed solution involves -
> 1. Clarifying the definition of MF_DELAYED to mean that memory failure
> handling is only partially completed, and that the metadata for the
> memory that failed (as in struct page/folio) is still referenced.
> 2. Updating shmem’s handling to align with the clarified definition.
> 3. Updating how the result of .error_remove_folio() is interpreted.
>
> RFC v2 is a more complete solution that includes parts 1 and 2 above to
> address David’s comment [1]. Selftests are included for all the above.

A few questions from Sashiko: