Re: [PATCH v3 1/4] mm/huge_memory: change folio_split_supported() to folio_check_splittable()
From: Zi Yan
Date: Wed Nov 26 2025 - 11:59:10 EST
On 26 Nov 2025, at 4:54, David Hildenbrand (Red Hat) wrote:
>> - /*
>> - * Folios that just got truncated cannot get split. Signal to the
>> - * caller that there was a race.
>> - *
>> - * TODO: this will also currently refuse shmem folios that are in the
>> - * swapcache.
>> - */
>> - if (!is_anon && !folio->mapping)
>> - return -EBUSY;
>> -
>> if (new_order >= old_order)
>> return -EINVAL;
>> - if (!folio_split_supported(folio, new_order, split_type, /* warn = */ true))
>> - return -EINVAL;
>> -
>> - is_hzp = is_huge_zero_folio(folio);
>> - if (is_hzp) {
>> - pr_warn_ratelimited("Called split_huge_page for huge zero page\n");
>> - return -EBUSY;
>
> As we are changing that case to a VM_WARN_ONCE(), is there some path where we might trigger that?
Based on the git history, this check is added for injecting errors
to huge zero folio and triggering memory failure handling.
>
> I'm wondering about the split_huge_pages_all() function in particular. I guess the "!folio_test_lru(folio)" would protect us?
I think so.
>
> Apart from that LGTM
>
> Acked-by: David Hildenbrand (Red Hat) <david@xxxxxxxxxx>
>
Thanks.
Best Regards,
Yan, Zi