git: 18a62137df40 - main - vm_object: use lookup_range in page_clean_flush
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 28 May 2025 05:36:38 UTC
The branch main has been updated by dougm:
URL: https://cgit.FreeBSD.org/src/commit/?id=18a62137df40da29d2258e024a778ee559dedd30
commit 18a62137df40da29d2258e024a778ee559dedd30
Author: Doug Moore <dougm@FreeBSD.org>
AuthorDate: 2025-05-28 05:33:43 +0000
Commit: Doug Moore <dougm@FreeBSD.org>
CommitDate: 2025-05-28 05:33:43 +0000
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
---
sys/vm/vm_object.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c
index 9b00aea9cdc8..1d372ba04488 100644
--- a/sys/vm/vm_object.c
+++ b/sys/vm/vm_object.c
@@ -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);