Re: [PATCH 1/3] mm: don't PTE-batch a swap-in over a hardware-poisoned subpage

From: Lorenzo Stoakes (ARM)

Date: Thu Nov 12 2026 - 07:01:30 EST


On Thu, Nov 12, 2026 at 09:56:39AM +0100, David Hildenbrand (Arm) wrote:
> On 11/11/26 14:18, Lorenzo Stoakes (ARM) wrote:
> > Hm, isn't scanning every single page in the folio potentially quite costly
> > here? I thought the point of batching was to improve performance overall?
>
> Yeah, we don't really want another helper to check for hwpoison.
>
> If we race with concurrent hwpoison, bad luck. The slapped on memory-failure
> code is full of races. That needs a proper long-term solution, not more pain to
> core-mm.

Yeah exactly. See Usama's reply - it really does narrow into a weird edge
case. Scan there if you want to scan at all.

Otherwise tough luck yes.

>
> So let's please try reusing existing helpers that test the large-folio bit.

Yes please!

--
Cheers, Lorenzo