Page MenuHomeFreeBSD

vm_page: Add batch page allocation routine
Needs ReviewPublic

Authored by bnovkov on Thu, Oct 10, 9:39 PM.

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
Build Status
Buildable 59896
Build 56781: arc lint + arc unit