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, Dec 26, 1:13 PM
Unknown Object (File)
Fri, Dec 20, 11:26 PM
Unknown Object (File)
Fri, Dec 20, 6:29 PM
Unknown Object (File)
Thu, Dec 19, 7:11 AM
Unknown Object (File)
Sun, Dec 15, 12:49 AM
Unknown Object (File)
Sun, Dec 15, 12:48 AM
Unknown Object (File)
Nov 21 2024, 12:01 AM
Unknown Object (File)
Nov 13 2024, 2:10 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