Re: [PATCH v2] mm/migrate: Avoid copying hwpoisoned folios during migration
From: David Hildenbrand (Arm)
Date: Tue Jul 07 2026 - 06:08:45 EST
On 7/7/26 11:01, Kaitao Cheng wrote:
> From: Kaitao Cheng <chengkaitao@xxxxxxxxxx>
>
> The generic folio migration path can copy the source folio after it has
> been unmapped. For normal and THP folios this goes through
> move_to_new_folio(), then the filesystem or anonymous migration callback,
> and commonly reaches folio_mc_copy().
>
> folio_mc_copy() uses copy_mc_highpage(), but architectures without
> copy_mc_to_kernel support fall back to copy_highpage(). If the source
> folio already contains a hwpoisoned page, a normal copy can consume the
> poisoned memory and trigger a synchronous machine check.
Well, but the code can still race with memory_failure() IIUC, so it's not really
safe either?
--
Cheers,
David