Re: [PATCH] x86/mm: fix freeing of PMD-sized vmemmap pages

David Hildenbrand (Arm)
2026-04-28T10:34:50Z

>
> -static void __meminit free_hugepage_table(struct page *page,
> +static void __meminit free_vmemmap_pages(struct page *page, unsigned int order,
> struct vmem_altmap *altmap)
> {
> - if (altmap)
> - vmem_altmap_free(altmap, PMD_SIZE / PAGE_SIZE);
> - else
> - free_pagetable(page, get_order(PMD_SIZE));
> + if (altmap) {
> + vmem_altmap_free(altmap, 1u << order);
> + } else if (PageReserved(page)) {
> + unsigned long nr_pages = 1 << order;

Staring at this code again, I should move that up so I can reuse it in the
vmem_altmap_free() call.

--
Cheers,

David