Module Name: src Committed By: skrll Date: Fri Dec 23 09:36:55 UTC 2016
Modified Files: src/sys/uvm: uvm_page.c Log Message: Fix uvm_page_physget_freelist so that it actually performs the two passes it mentions. To generate a diff of this commit: cvs rdiff -u -r1.190 -r1.191 src/sys/uvm/uvm_page.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/uvm/uvm_page.c diff -u src/sys/uvm/uvm_page.c:1.190 src/sys/uvm/uvm_page.c:1.191 --- src/sys/uvm/uvm_page.c:1.190 Fri Dec 23 07:15:28 2016 +++ src/sys/uvm/uvm_page.c Fri Dec 23 09:36:55 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: uvm_page.c,v 1.190 2016/12/23 07:15:28 cherry Exp $ */ +/* $NetBSD: uvm_page.c,v 1.191 2016/12/23 09:36:55 skrll Exp $ */ /* * Copyright (c) 1997 Charles D. Cranor and Washington University. @@ -66,7 +66,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.190 2016/12/23 07:15:28 cherry Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.191 2016/12/23 09:36:55 skrll Exp $"); #include "opt_ddb.h" #include "opt_uvm.h" @@ -619,9 +619,9 @@ uvm_page_physget_freelist(paddr_t *paddr /* pass 1: try allocating from a matching end */ #if (VM_PHYSSEG_STRAT == VM_PSTRAT_BIGFIRST) - for (lcv = uvm_physseg_get_last() ; uvm_physseg_valid_p(lcv) ; lcv = uvm_physseg_get_prev(lcv)) + for (lcv = uvm_physseg_get_last(); uvm_physseg_valid_p(lcv); lcv = uvm_physseg_get_prev(lcv)) #else - for (lcv = uvm_physseg_get_first() ; uvm_physseg_valid_p(lcv) ; lcv = uvm_physseg_get_next(lcv)) + for (lcv = uvm_physseg_get_first(); uvm_physseg_valid_p(lcv); lcv = uvm_physseg_get_next(lcv)) #endif { if (uvm.page_init_done == true) @@ -633,13 +633,13 @@ uvm_page_physget_freelist(paddr_t *paddr continue; } else return true; - + } /* pass2: forget about matching ends, just allocate something */ #if (VM_PHYSSEG_STRAT == VM_PSTRAT_BIGFIRST) - for (lcv = uvm_physseg_get_last() ; uvm_physseg_valid_p(lcv); lcv = uvm_physseg_get_prev(lcv)) + for (lcv = uvm_physseg_get_last(); uvm_physseg_valid_p(lcv); lcv = uvm_physseg_get_prev(lcv)) #else - for (lcv = uvm_physseg_get_first() ; uvm_physseg_valid_p(lcv) ; lcv = uvm_physseg_get_next(lcv)) + for (lcv = uvm_physseg_get_first(); uvm_physseg_valid_p(lcv); lcv = uvm_physseg_get_next(lcv)) #endif { /* Try the front regardless. */ @@ -649,7 +649,6 @@ uvm_page_physget_freelist(paddr_t *paddr } else return true; } - } return false; }