mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-10-28 11:25:21 +01:00
vm_object: use lookup_range in page_clean_flush
In vm_object_page_clean_flush, 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 looked-up. This achieves a small performance improvement. Reviewed by: alc Differential Revision: https://reviews.freebsd.org/D50425
This commit is contained in:
1 parent
d094dd9071
commit
18a62137df
1 file changed
+5
-4
+5
-4
@@ -1008,15 +1008,16 @@ vm_object_page_clean_flush(struct pctrie_iter *pages, vm_page_t p,
|
||||
vm_page_lock_assert(p, MA_NOTOWNED);
|
||||
vm_page_assert_xbusied(p);
|
||||
ma[0] = p;
|
||||
for (count = 1; count < vm_pageout_page_count; count++) {
|
||||
p = vm_radix_iter_next(pages);
|
||||
if (p == NULL || vm_page_tryxbusy(p) == 0)
|
||||
runlen = vm_radix_iter_lookup_range(pages, p->pindex + 1,
|
||||
&ma[1], vm_pageout_page_count - 1);
|
||||
for (count = 1; count <= runlen; count++) {
|
||||
p = ma[count];
|
||||
if (vm_page_tryxbusy(p) == 0)
|
||||
break;
|
||||
if (!vm_object_page_remove_write(p, flags, allclean)) {
|
||||
vm_page_xunbusy(p);
|
||||
break;
|
||||
}
|
||||
ma[count] = p;
|
||||
}
|
||||
|
||||
vm_pageout_flush(ma, count, pagerflags, 0, &runlen, eio);
|
||||
|
||||
Reference in new issue
Block a user