Re: [PATCH v6 0/5] Only free healthy pages in high-order has_hwpoisoned folio
From: David Hildenbrand (Arm)
Date: Mon Jul 06 2026 - 06:01:18 EST
On 7/5/26 20:50, Andrew Morton wrote:
> On Sun, 5 Jul 2026 18:07:09 +0000 Jiaqi Yan <jiaqiyan@xxxxxxxxxx> wrote:
>
>> At the end of dissolve_free_hugetlb_folio(), a free HugeTLB
>> folio becomes non-HugeTLB and is released to buddy allocator
>> as a high-order folio, e.g. a folio that contains 262144 pages
>> if the folio was a 1G HugeTLB hugepage.
>>
>> ...
>>
>> Introduce free_has_hwpoisoned() to only free the healthy pages
>> and exclude the HWPoison ones in the high-order folio.
>> free_has_hwpoisoned() happens at the end of free_pages_prepare(),
>> which already deals with both decomposing the original compound
>> page, updating page metadata like alloc tag and page owner.
>> It is also only applied when PG_has_hwpoisoned indicates folio
>> contains certain HWPoison page(s) for performance reason.
>> Its idea is to iterate through the sub-pages of the folio to
>> identify contiguous ranges of healthy pages. Instead of freeing
>> pages one by one, free_has_hwpoisoned() then re-use
>> free_prepared_contig_range() [11] to decompose healthy ranges into
>> the largest possible chunks of different orders. Every chunk is
>> freed via __free_frozen_pages().
>
> Thanks. I'll await further reviewer input before taking any action
> with this series.
FWIW, I want Vlastimil to ack this before this goes upstream.
--
Cheers,
David