Page MenuHomeFreeBSD

vm_page: Teach vm_page_grab_pages to batch page allocations
Needs ReviewPublic

Authored by bnovkov on Thu, Oct 10, 9:39 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Nov 2, 8:20 AM
Unknown Object (File)
Sat, Oct 19, 9:24 PM
Unknown Object (File)
Sat, Oct 12, 9:59 PM
Unknown Object (File)
Fri, Oct 11, 4:41 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