Module Name:    src
Committed By:   reinoud
Date:           Fri Mar  2 16:56:33 UTC 2012

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

Log Message:
Move from pool(9) to kmem_zalloc(9) for L2 page tables. A pool with PAGE_SIZE
elements is accepted but seems to panic now and then claiming it can't find
the header info.

XXX should this be PR'd?


To generate a diff of this commit:
cvs rdiff -u -r1.102 -r1.103 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.102 src/sys/arch/usermode/usermode/pmap.c:1.103
--- src/sys/arch/usermode/usermode/pmap.c:1.102	Sat Jan 14 17:42:52 2012
+++ src/sys/arch/usermode/usermode/pmap.c	Fri Mar  2 16:56:32 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.102 2012/01/14 17:42:52 reinoud Exp $ */
+/* $NetBSD: pmap.c,v 1.103 2012/03/02 16:56:32 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.102 2012/01/14 17:42:52 reinoud Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.103 2012/03/02 16:56:32 reinoud Exp $");
 
 #include "opt_memsize.h"
 #include "opt_kmempages.h"
@@ -37,6 +37,7 @@ __KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.1
 #include <sys/param.h>
 #include <sys/mutex.h>
 #include <sys/buf.h>
+#include <sys/kmem.h>
 #include <sys/malloc.h>
 #include <sys/pool.h>
 #include <machine/thunk.h>
@@ -95,7 +96,6 @@ static uint64_t pm_entries_size = 0;
 
 static struct pool pmap_pool;
 static struct pool pmap_l1_pool;
-static struct pool pmap_l2_pool;
 static struct pool pmap_pventry_pool;
 
 /* forwards */
@@ -451,8 +451,6 @@ pmap_deferred_init(void)
 	/* create pmap pool */
 	pool_init(&pmap_pool, sizeof(struct pmap), 0, 0, 0,
 	    "pmappool", NULL, IPL_NONE);
-	pool_init(&pmap_l2_pool, PMAP_L2_SIZE, 0, 0, 0,
-	    "pmapl2pool", NULL, IPL_HIGH);
 	pool_init(&pmap_l1_pool, pm_l1_size, 0, 0, 0,
 	    "pmapl1pool", NULL, IPL_NONE);
 	pool_init(&pmap_pventry_pool, sizeof(struct pv_entry), 0, 0, 0,
@@ -529,7 +527,7 @@ pmap_destroy(pmap_t pmap)
 		l2tbl = pmap->pm_l1[l1];
 		if (!l2tbl)
 			continue;
-		pool_put(&pmap_l2_pool, l2tbl);
+		kmem_free(l2tbl, PMAP_L2_SIZE);
 	}
 	pool_put(&pmap_l1_pool, pmap->pm_l1);
 	pool_put(&pmap_pool, pmap);
@@ -623,8 +621,8 @@ pmap_set_pv(pmap_t pmap, uintptr_t lpn, 
 
 	l2tbl = pmap->pm_l1[l1];
 	if (!l2tbl) {
-		l2tbl = pmap->pm_l1[l1] = pool_get(&pmap_l2_pool, PR_WAITOK);
-		memset(l2tbl, 0, PMAP_L2_SIZE);
+		l2tbl = pmap->pm_l1[l1] = kmem_zalloc(PMAP_L2_SIZE, KM_SLEEP);
+		/* should be zero filled */
 	}
 	l2tbl->pm_l2[l2] = pv;
 }

Reply via email to