Re: [PATCH v3 1/4] mm/huge_memory: change folio_split_supported() to folio_check_splittable()

From: David Hildenbrand (Red Hat)

Date: Wed Nov 26 2025 - 04:55:01 EST


- /*
- * 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?

I'm wondering about the split_huge_pages_all() function in particular. I guess the "!folio_test_lru(folio)" would protect us?

Apart from that LGTM

Acked-by: David Hildenbrand (Red Hat) <david@xxxxxxxxxx>

--
Cheers

David