Re: [PATCH 1/3] khugepaged: Optimize __collapse_huge_page_copy_succeeded() by PTE batching

From: David Hildenbrand
Date: Wed Jun 25 2025 - 08:22:28 EST


if (folio_test_large(src)) {
int max_nr_ptes = (end - address) >> PAGE_SHIFT;

nr_ptes = folio_pte_batch(src, address, _pte,
pteval, max_nr_ptes,
flags, NULL, NULL, NULL);
}

BTW I think David raised it, but is there a way to wrap folio_pte_batch() to not
have to NULL, NULL, NULL here? :)

I'm working on a cleanup for all that. So stay tuned :)

--
Cheers,

David / dhildenb