In vm_object_page_clean_flush and vm_pageout_cluster, replace the loop that uses vm_radix_iter_next to visit consecutive pages with a call to
vm_radix_iter_lookup_range, then a loop to check the pages.
Details
- Reviewers
alc markj kib - Commits
- rG18a62137df40: vm_object: use lookup_range in page_clean_flush
I tested by running several buildworlds while I counted function calls and cycles spent per call (not counting the time in vm_pageout_flush).
Original:
Calls Cycles/call 27929 2974.9316839127787 27929 2983.8554549035052 27928 2993.4640146089946
Modified:
Calls Cycles/call 27929 2863.995273729815 27928 2908.8322114007447 27930 2899.870032223416
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
sys/vm/vm_object.c | ||
---|---|---|
1143–1144 | From what I can see, pctrie_iter_lookup_range() doesn't update the iterator index. Is that correct? If so, how do we know what "prev" is relative to? |
sys/vm/vm_object.c | ||
---|---|---|
1143–1144 | That is correct. "prev" is relative to where the cursor pointed when the function was called, which is the same place that "next" is relative to now - the pindex of the page passed into the function. BTW, I hope to replace the "prev" parts with a backward-walking version of lookup_range, but it' s too much to put in this patch I think, and it needs more work. |
Limit the changes to just vm_object_page_clean_flush. Provide more meaningful performance results.