Page MenuHomeFreeBSD

vm_page: Add batch page allocation routine
Needs ReviewPublic

Authored by bnovkov on Thu, Oct 10, 9:39 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Nov 3, 1:43 PM
Unknown Object (File)
Sat, Nov 2, 6:28 PM
Unknown Object (File)
Tue, Oct 29, 2:09 PM
Unknown Object (File)
Sat, Oct 26, 10:31 AM
Unknown Object (File)
Thu, Oct 24, 5:57 AM
Unknown Object (File)
Wed, Oct 23, 3:05 PM
Unknown Object (File)
Tue, Oct 22, 12:04 PM
Unknown Object (File)
Mon, Oct 21, 6:11 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