Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/usermode/usermode Move from pool(9) to kmem_zalloc(...
details: https://anonhg.NetBSD.org/src/rev/74524316144a
branches: trunk
changeset: 777733:74524316144a
user: reinoud <reinoud%NetBSD.org@localhost>
date: Fri Mar 02 16:56:32 2012 +0000
description:
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?
diffstat:
sys/arch/usermode/usermode/pmap.c | 14 ++++++--------
1 files changed, 6 insertions(+), 8 deletions(-)
diffs (63 lines):
diff -r 26494a766541 -r 74524316144a sys/arch/usermode/usermode/pmap.c
--- a/sys/arch/usermode/usermode/pmap.c Fri Mar 02 16:43:30 2012 +0000
+++ b/sys/arch/usermode/usermode/pmap.c Fri Mar 02 16:56:32 2012 +0000
@@ -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 <reinoud%NetBSD.org@localhost>
@@ -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 @@
#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 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 @@
/* 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 @@
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 @@
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;
}
Home |
Main Index |
Thread Index |
Old Index