Re: [PATCH 3/4] mm/mprotect: un-inline folio_pte_batch_flags()

David Hildenbrand (Arm)
2026-03-20T11:02:26Z

>
> which the compiler FWIW tries to inline it all into one function, but then
> does a poor job at figuring things out. And the CPU gets confused too. It
> was frankly shocking how much performance I could squeeze out of a
>
> if (nr_ptes == 1) {
> /* don't bother with the loops and the funny logic */
> }

Yes, same experience with fork/munmap.

--
Cheers,

David