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)
Feb 20 2024, 11:47 AM
Unknown Object (File)
Dec 22 2023, 11:45 PM
Unknown Object (File)
Dec 13 2023, 8:09 PM
Unknown Object (File)
Oct 21 2023, 5:09 PM
Unknown Object (File)
Sep 26 2023, 4:38 AM
Unknown Object (File)
Sep 24 2023, 12:54 PM
Unknown Object (File)
Sep 16 2023, 8:24 PM
Unknown Object (File)
Aug 27 2023, 6:47 PM
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.