Page MenuHomeFreeBSD

vm_page: Teach vm_page_grab_pages to batch page allocations
Needs ReviewPublic

Authored by bnovkov on Oct 10 2024, 9:39 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Dec 17, 2:27 PM
Unknown Object (File)
Tue, Dec 17, 3:24 AM
Unknown Object (File)
Wed, Dec 4, 3:38 AM
Unknown Object (File)
Sat, Nov 23, 11:24 AM
Unknown Object (File)
Thu, Nov 21, 3:22 AM
Unknown Object (File)
Nov 7 2024, 7:44 AM
Unknown Object (File)
Nov 6 2024, 1:44 AM
Unknown Object (File)
Nov 2 2024, 8:20 AM
Subscribers

Details

Reviewers
markj
alc
kib
Summary

This change modifies vm_page_grab_pages to use vm_page_alloc_pages.
Instead of allocating and inserting one page at a time,
vm_page_grab_pages will now inspect the object's memq or the radix
tree to determine how many pages can be allocated from the
current offset and allocate them using vm_page_alloc_pages.

Tested by: gallatin

Test Plan

All changes have been stress-tested and performance-tested using sendfile.
@gallatin has tested the entire patch series on a machine with the following specs:
Xeon E5-2697A v4 @ 2.60GHz, 1x Mellanox ConnectX4 100GbE, 4x nvme, 128GB DDR4-2400
The results showed a 3.5% reduction in CPU usage when serving Netflix video traffic.

I've also evaluated vm_page_alloc_pages using a simple microbenchmark that allocates
N pages at a time and compared it to the common 'vm_page_alloc_page + forloop' approach.
The plotted results are available at https://people.freebsd.org/~bnovkov/plots/batch_alloc_plot.png

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 59897
Build 56782: arc lint + arc unit