On Mon, Jun 30, 2025 at 11:19:13AM +0200, David Hildenbrand wrote:
On 27.06.25 20:48, Lorenzo Stoakes wrote:
On Fri, Jun 27, 2025 at 01:55:09PM +0200, David Hildenbrand wrote:
Many users (including upcoming ones) don't really need the flags etc,
and can live with a function call.
So let's provide a basic, non-inlined folio_pte_batch().
Hm, but why non-inlined, when it invokes an inlined function? Seems odd no?
We want to always generate a function that uses as little runtime checks as
possible. Essentially, optimize out the "flags" as much as possible.
In case of folio_pte_batch(), where we won't use any flags, any checks will
be optimized out by the compiler.
So we get a single, specialized, non-inlined function.
I mean I suppose code bloat is a thing too. Would the compiler not also optimise
out checks if it were inlined though?
Obviously, I had that as part of the development, and decided against it at
some point. :)
Yeah, _ext() is not common in MM yet, in contrast to other subsystems. The
only user is indeed page_ext. On arm we seem to have set_pte_ext(). But it's
really "page_ext", that's the problematic part, not "_ext" :P
No strong opinion, but I tend to dislike here "__", because often it means
"internal helper you're not supposed to used", which isn't really the case
here.
Yeah, and of course we break this convention all over the place :)
Maybe folio_pte_batch_flags()?