Matt Thomas <m...@netbsd.org> writes: > Module Name: src > Committed By: matt > Date: Tue Jan 18 21:43:29 UTC 2011 > > Modified Files: > src/sys/uvm: uvm_page.h uvm_pglist.c > > Log Message: > Improve the efficiency of searching for a contiguous set of free pages. > > > To generate a diff of this commit: > cvs rdiff -u -r1.69 -r1.70 src/sys/uvm/uvm_page.h > cvs rdiff -u -r1.51 -r1.52 src/sys/uvm/uvm_pglist.c
On the second pass of simple case, simply continue'ing the loop misses the first page. enami. Index: uvm_pglist.c =================================================================== RCS file: /cvsroot/src/sys/uvm/uvm_pglist.c,v retrieving revision 1.58 diff -u -r1.58 uvm_pglist.c --- uvm_pglist.c 24 Jan 2011 22:54:01 -0000 1.58 +++ uvm_pglist.c 25 Jan 2011 03:40:22 -0000 @@ -390,6 +390,7 @@ if (high <= ps->avail_start || low >= ps->avail_end) return 0; +again: for (;; try++, pg++) { if (try >= limit) { if (ps->start_hint == 0 || second_pass) { @@ -400,7 +401,7 @@ try = max(low, ps->avail_start); limit = min(limit, ps->avail_start + ps->start_hint); pg = &ps->pgs[try - ps->start]; - continue; + goto again; } #if defined(DEBUG) {