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)
Thu, Nov 21, 12:01 AM
Unknown Object (File)
Wed, Nov 13, 2:10 PM
Unknown Object (File)
Wed, Nov 13, 12:24 PM
Unknown Object (File)
Wed, Nov 13, 3:19 AM
Unknown Object (File)
Wed, Nov 6, 4:43 AM
Unknown Object (File)
Wed, Nov 6, 1:48 AM
Unknown Object (File)
Sun, Nov 3, 1:43 PM
Unknown Object (File)
Sat, Nov 2, 6:28 PM
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