Page MenuHomeFreeBSD

Have vm_page_grab_pages() support VM_ALLOC_NOWAIT
ClosedPublic

Authored by markj on Aug 10 2017, 1:22 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Dec 21, 4:09 PM
Unknown Object (File)
Fri, Dec 13, 6:05 PM
Unknown Object (File)
Sun, Nov 24, 10:58 AM
Unknown Object (File)
Nov 19 2024, 1:59 AM
Unknown Object (File)
Nov 16 2024, 3:46 PM
Unknown Object (File)
Nov 14 2024, 5:30 PM
Unknown Object (File)
Nov 5 2024, 5:16 PM
Unknown Object (File)
Oct 4 2024, 4:46 AM
Subscribers

Details

Summary

The return value now gives the number of pages (starting at the
requested pindex) returned. This lets sendfile() use vm_page_grab_pages(),
which is marginally more cache-friendly.

Test Plan

I tried this patch with a simple benchmark that uses an AF_UNIX
stream socket pair to simulate a sendfile() to /dev/null. Throughput
goes up by about 1.5% when sending a large (8GB) memory-resident
file.

Edit: I had previous claimed a larger improvement, but had accidentally
been testing with the patch from D11943 applied as well.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

markj added reviewers: alc, glebius, kib.
alc added inline comments.
sys/vm/vm_page.c
3181 ↗(On Diff #31839)

I would suggest the phrase "partial prefix". I think it conveys more information.

This revision is now accepted and ready to land.Aug 10 2017, 3:49 PM

Brett, I added you to this change, because it will decrease the time spent in vm_radix_lookup() by your shm_open()/sendfile() test case.

markj edited edge metadata.
  • Clarify the vm_page_grab_pages() comment.
This revision now requires review to proceed.Aug 10 2017, 9:13 PM
This revision is now accepted and ready to land.Aug 11 2017, 11:37 AM
This revision was automatically updated to reflect the committed changes.