Re: [PATCH 1/2] mm/compaction: skip folios containing hwpoisoned pages
From: David Hildenbrand (Arm)
Date: Wed Oct 21 2026 - 04:28:12 EST
On 10/21/26 04:49, Kaitao Cheng wrote:
>
>
> 在 2026/10/20 21:58, David Hildenbrand (Arm) 写道:
>> On 10/20/26 15:31, Kaitao Cheng wrote:
>>>
>>>
>>> 在 2026/10/20 21:07, David Hildenbrand (Arm) 写道:
>>>
>>> It does require architecture support, but that doesn't seem practical, haha.
>>
>> Well, but that's required when an arch wants to rule out all races.
>>
>>>
>>>
>>> Do we need to check both before and after the copy? This feels a bit
>>> redundant, and I'm not sure whether such a small race window warrants
>>> an additional check.
>>>
>>
>> I don't see how checking after the copy makes any sense? :)
>>
>> You already crashed if there was a problem, why check? Or what am I missing?
> In cases such as transient errors, software poison injection, repeated
> bit flips in memory, or bit flips in the ECC check bits themselves, a
> page may be faulty while memcpy() still completes normally. If the copied
> data is correct, only the PG_hwpoison flag is lost during migration. But
> if the copied data is corrupted and the kernel or a process subsequently
> treats it as valid, I think the consequences could be more serious than
> an immediate crash. However, I cannot estimate how likely this is to happen.
That's the point, me neither. I'm happy to perform checks before access, or
after, in the default copy implementation, but I want to have properly
documented how this makes sense and which races exist.
--
Cheers,
David