This reduces work done under vm_page_insert for large objects.
Sponsored by: Dell EMC Isilon
Differential D45486
vm_page_insert: use pctrie combined insert/lookup rlibby on Jun 4 2024, 7:38 PM. Authored by Tags None Referenced Files
Subscribers
Details
Diff Detail
Event Timeline
Comment Actions Mark vm_page_insert_lookup as __always_inline, and reword the comment. Checking the generated code, the plain inline keyword was not enough to gcc13 inlines everything either way, generating vm_page_insert and Mention this in the comment and also tweak the comment to address
Comment Actions In principle, this is fine, but in practice. we mostly call vm_page_insert_after(). So, the impact will be limited. That said, I'm still excited by where I think this is headed. Have you thought about how the repeated walk will be eliminated from vm_page_alloc() (and vm_page_insert_after()), where we need mpred before the radix tree insertion to lookup a reservation? I can imagine a function akin to vm_radix_insert_lookup_lt() that doesn't take a vm_page pointer as an argument but instead returns a pointer to where that vm_page pointer should be stored in the radix tree once we know what the allocated vm_page is. Better yet. this new function would return some sort of "iterator" that would enable vm_page_grab_pages() to insert multiple pages without repeating the radix tree walk on every insertion. Comment Actions Yes, at this point this is opportunistic given the pctrie combined lookup/insert, which I was originally interested in for the getblk/bgetvp patch (D45395).
Thanks for the ideas. Honestly, I don't have a concrete plan, but I am thinking about it. You probably saw related comments from markj and jeff in D45396. An iterator that may also be able to handle batch inserts efficiently is an interesting idea. |