Module Name: src
Committed By: matt
Date: Fri Jan 22 08:54:41 UTC 2010
Modified Files:
src/sys/uvm [matt-nb5-mips64]: uvm_pglist.c
Log Message:
Remove some optimizations since they actually don't do the right thing.
We never want to test the starting page first since it doesn't really give
use any good information that we can use for the next pass.
To generate a diff of this commit:
cvs rdiff -u -r1.42.16.2 -r1.42.16.3 src/sys/uvm/uvm_pglist.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_pglist.c
diff -u src/sys/uvm/uvm_pglist.c:1.42.16.2 src/sys/uvm/uvm_pglist.c:1.42.16.3
--- src/sys/uvm/uvm_pglist.c:1.42.16.2 Fri Jan 22 06:05:16 2010
+++ src/sys/uvm/uvm_pglist.c Fri Jan 22 08:54:41 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: uvm_pglist.c,v 1.42.16.2 2010/01/22 06:05:16 snj Exp $ */
+/* $NetBSD: uvm_pglist.c,v 1.42.16.3 2010/01/22 08:54:41 matt Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_pglist.c,v 1.42.16.2 2010/01/22 06:05:16 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_pglist.c,v 1.42.16.3 2010/01/22 08:54:41 matt Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -187,41 +187,22 @@
__func__, ps, tryidx, end, skip, align);
#endif
/*
- * Test both the ending and starting pages to see if they are
- * both free. If the ending and starting pages are same page,
- * we only test one of them. If the pages aren't free, there
- * is no reason to continue this iteration so advance to the
- * next address and try again.
- */
- if (VM_PAGE_IS_FREE(&pgs[end - 1]) == 0
- || end - 1 == tryidx + skip
- || VM_PAGE_IS_FREE(&pgs[tryidx + skip]) == 0) {
- try += roundup(num, align);
- skip = 0;
- continue;
- }
-
- /*
- * We start at the end since if we find a non-free page, it
- * makes no sense to ever test any pages before it since the
- * conditions for this allocation could never be satisified.
- *
- * Also since we have "vetted" these free pages, if this
- * iteration fails, we may be able to skip testing those pages
- * in the next iteration.
+ * We start at the end and work backwards since if we find a
+ * non-free page, it makes no sense to continue.
*
- * The loop condition will never be satisfied if we've already
- * found enough pages (either one or two).
+ * But on the plus size we have "vetted" some number of free
+ * pages. If this iteration fails, we may be able to skip
+ * testing most of those pages again in the next pass.
*/
- for (idx = end - 2; idx >= tryidx + skip + 1; idx--) {
+ for (idx = end - 1; idx >= tryidx + skip; idx--) {
if (VM_PAGE_IS_FREE(&pgs[idx]) == 0) {
ok = false;
break;
}
#ifdef DEBUG
- idxpa = VM_PAGE_TO_PHYS(&pgs[idx]);
if (idx > tryidx) {
+ idxpa = VM_PAGE_TO_PHYS(&pgs[idx]);
lastidxpa = VM_PAGE_TO_PHYS(&pgs[idx - 1]);
if ((lastidxpa + PAGE_SIZE) != idxpa) {
/*