Module Name:    src
Committed By:   matt
Date:           Sat Jan 23 20:03:28 UTC 2010

Modified Files:
        src/sys/uvm [matt-nb5-mips64]: uvm_pglist.c

Log Message:
Use roundup2 instead of roundup when doing alignment rounding since all
alignments must be a power of 2. (thanks to rmind for suggesting it).


To generate a diff of this commit:
cvs rdiff -u -r1.42.16.4 -r1.42.16.5 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.4 src/sys/uvm/uvm_pglist.c:1.42.16.5
--- src/sys/uvm/uvm_pglist.c:1.42.16.4	Sat Jan 23 19:54:04 2010
+++ src/sys/uvm/uvm_pglist.c	Sat Jan 23 20:03:28 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_pglist.c,v 1.42.16.4 2010/01/23 19:54:04 matt Exp $	*/
+/*	$NetBSD: uvm_pglist.c,v 1.42.16.5 2010/01/23 20:03:28 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.4 2010/01/23 19:54:04 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_pglist.c,v 1.42.16.5 2010/01/23 20:03:28 matt Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -144,7 +144,7 @@
 	 * We start our search at the just after where the last allocation
 	 * succeeded.
 	 */
-	try = roundup(max(low, ps->avail_start + ps->start_hint), alignment);
+	try = roundup2(max(low, ps->avail_start + ps->start_hint), alignment);
 	limit = min(high, ps->avail_end);
 	pagemask = ~((boundary >> PAGE_SHIFT) - 1);
 	skip = 0;
@@ -168,7 +168,7 @@
 			 * is were we started.
 			 */
 			second_pass = true;
-			try = roundup(max(low, ps->avail_start), alignment);
+			try = roundup2(max(low, ps->avail_start), alignment);
 			limit = min(high, ps->avail_start + ps->start_hint);
 			skip = 0;
 			continue;
@@ -180,7 +180,7 @@
 			 * just crossed and ensure alignment.
 			 */
 			try = (try + num - 1) & pagemask;
-			try = roundup(try, alignment);
+			try = roundup2(try, alignment);
 			skip = 0;
 			continue;
 		}
@@ -265,7 +265,7 @@
 		/*
 		 * now round up that to the needed alignment.
 		 */
-		cnt = roundup(cnt, alignment);
+		cnt = roundup2(cnt, alignment);
 		/*
 		 * The number of pages we can skip checking 
 		 * (might be 0 if cnt > num).
@@ -499,7 +499,7 @@
 	if (boundary != 0 && boundary < size)
 		return (EINVAL);
 	num = atop(round_page(size));
-	low = roundup(low, alignment);
+	low = roundup2(low, alignment);
 
 	TAILQ_INIT(rlist);
 

Reply via email to