Module Name:    src
Committed By:   reinoud
Date:           Thu Sep 15 14:45:22 UTC 2011

Modified Files:
        src/sys/arch/usermode/usermode: pmap.c

Log Message:
Only activate pages that are in active pmaps


To generate a diff of this commit:
cvs rdiff -u -r1.63 -r1.64 src/sys/arch/usermode/usermode/pmap.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/arch/usermode/usermode/pmap.c
diff -u src/sys/arch/usermode/usermode/pmap.c:1.63 src/sys/arch/usermode/usermode/pmap.c:1.64
--- src/sys/arch/usermode/usermode/pmap.c:1.63	Thu Sep 15 12:25:25 2011
+++ src/sys/arch/usermode/usermode/pmap.c	Thu Sep 15 14:45:22 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.63 2011/09/15 12:25:25 reinoud Exp $ */
+/* $NetBSD: pmap.c,v 1.64 2011/09/15 14:45:22 reinoud Exp $ */
 
 /*-
  * Copyright (c) 2011 Reinoud Zandijk <rein...@netbsd.org>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.63 2011/09/15 12:25:25 reinoud Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.64 2011/09/15 14:45:22 reinoud Exp $");
 
 #include "opt_memsize.h"
 #include "opt_kmempages.h"
@@ -465,7 +465,7 @@
 	}
 	/* If this mapping exists already, use that. */
 	for (pv = pv; pv != NULL; pv = pv->pv_next) {
-		if (pv->pv_pmap == pmap && pv->pv_lpn == lpn) {
+		if ((pv->pv_pmap == pmap) && (pv->pv_lpn == lpn)) {
 			return pv;
 		}
 	}
@@ -676,7 +676,11 @@
 			ppn, pv->pv_pmap);
 		if (pv->pv_pmap != NULL) {
 			pv_update(pv);
-			pmap_page_activate(pv);
+			if (pv->pv_pmap->pm_flags & PM_ACTIVE)
+				pmap_page_activate(pv);
+			else
+				pmap_page_deactivate(pv)
+			;
 		}
 	}
 }

Reply via email to