Page MenuHomeFreeBSD

vm_page: Add batch page allocation routine
Needs ReviewPublic

Authored by bnovkov on Oct 10 2024, 9:39 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Feb 3, 4:59 AM
Unknown Object (File)
Thu, Jan 30, 5:30 AM
Unknown Object (File)
Thu, Jan 30, 5:15 AM
Unknown Object (File)
Sun, Jan 26, 2:42 PM
Unknown Object (File)
Sat, Jan 25, 9:55 AM
Unknown Object (File)
Fri, Jan 17, 1:09 PM
Unknown Object (File)
Jan 10 2025, 11:21 AM
Unknown Object (File)
Jan 10 2025, 5:59 AM
Subscribers

Details

Reviewers
markj
alc
kib
Summary

This change introduces vm_page_alloc_pages - a routine designed
to allocate multiple pages in a faster and more cache-friendly way.
It is meant to be used as a replacement for any code calling
'vm_page_alloc_page' in a loop. It uses batch domain iterators to
allocate smaller batches of pages from different domains and inserts
them into thebacking object in one go using the batch pctrie
insertion routines.

Given a target domain, vm_page_alloc_pages will first try to allocate
pages from any underlying reservations. If an insufficient amount of
pages was allocated, it'll move on to the PCPU page cache and fall back
to vm_phys_alloc_npages before giving up. The routine returns the
number of pages it managed to allocate, which may be lower than the
requested amount if 'VM_ALLOC_WAITOK' was not passed.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

Update patch after pctrie_batch_insert argument change.

Simplify patch by switching to loop-based vm_page_iter_insert radix insertion.

After the last two diff updates the patch is no longer blocked on the pctrie batching patches and is ready for review. I'd appreciate any input on this patch (and other in the series).