Diff below merges two equivalent if blocks. No functional change, ok?
Index: uvm/uvm_pdaemon.c =================================================================== RCS file: /cvs/src/sys/uvm/uvm_pdaemon.c,v retrieving revision 1.107 diff -u -p -r1.107 uvm_pdaemon.c --- uvm/uvm_pdaemon.c 16 Oct 2023 11:32:54 -0000 1.107 +++ uvm/uvm_pdaemon.c 17 Oct 2023 10:28:25 -0000 @@ -650,6 +650,11 @@ uvmpd_scan_inactive(struct uvm_pmalloc * p->offset >> PAGE_SHIFT, swslot + swcpages); swcpages++; + rw_exit(slock); + + /* cluster not full yet? */ + if (swcpages < swnpages) + continue; } } else { /* if p == NULL we must be doing a last swap i/o */ @@ -666,14 +671,6 @@ uvmpd_scan_inactive(struct uvm_pmalloc * * for object pages, we always do the pageout. */ if (swap_backed) { - if (p) { /* if we just added a page to cluster */ - rw_exit(slock); - - /* cluster not full yet? */ - if (swcpages < swnpages) - continue; - } - /* starting I/O now... set up for it */ npages = swcpages; ppsp = swpps;