the call to uvm_km_valloc() in pmap_init() can end up triggering a call to

pmap_growkernel() on large memory machines.  at this point we've already
called uvm_page_init(), so we can no longer use uvm_page_physget().
but the flag we use to decide whether to use uvm_page_physget() vs.
uvm_pagealloc() is only set at the end of pmap_init(), so we use
uvm_page_physget() anyway.  switch to using uvm.page_init_done to decide
how to allocate pages, since that's the real indicator of when we have to
change methods.
This commit is contained in:
chs 2001-05-17 02:31:26 +00:00
parent bcc2ce4f8c
commit 8f77918d6c

View File

@ -1,4 +1,4 @@
/* $NetBSD: pmap.c,v 1.95 2001/04/24 04:31:13 thorpej Exp $ */ /* $NetBSD: pmap.c,v 1.96 2001/05/17 02:31:26 chs Exp $ */
#undef NO_VCACHE /* Don't forget the locked TLB in dostart */ #undef NO_VCACHE /* Don't forget the locked TLB in dostart */
#define HWREF #define HWREF
/* /*
@ -311,8 +311,6 @@ int memsize;
static int memh = 0, vmemh = 0; /* Handles to OBP devices */ static int memh = 0, vmemh = 0; /* Handles to OBP devices */
static int pmap_initialized;
int avail_start, avail_end; /* These are used by ps & family */ int avail_start, avail_end; /* These are used by ps & family */
static int ptelookup_va __P((vaddr_t va)); /* sun4u */ static int ptelookup_va __P((vaddr_t va)); /* sun4u */
@ -1430,8 +1428,6 @@ pmap_init()
pvh += s; pvh += s;
} }
pmap_initialized = 1;
/* Setup a pool for additional pvlist structures */ /* Setup a pool for additional pvlist structures */
pool_init(&pv_pool, sizeof(struct pv_entry), 0, 0, 0, "pv_entry", 0, pool_init(&pv_pool, sizeof(struct pv_entry), 0, 0, 0, "pv_entry", 0,
NULL, NULL, 0); NULL, NULL, 0);
@ -1490,8 +1486,7 @@ pmap_growkernel(maxkvaddr)
DPRINTF(PDB_GROW, DPRINTF(PDB_GROW,
("pmap_growkernel: extending %lx\n", kbreak)); ("pmap_growkernel: extending %lx\n", kbreak));
pg = 0; pg = 0;
if (pmap_initialized || if (uvm.page_init_done || !uvm_page_physget(&pg)) {
!uvm_page_physget(&pg)) {
vm_page_t page; vm_page_t page;
DPRINTF(PDB_GROW, DPRINTF(PDB_GROW,
("pmap_growkernel: need to alloc page\n")); ("pmap_growkernel: need to alloc page\n"));
@ -1891,7 +1886,7 @@ pmap_kenter_pa(va, pa, prot)
pg = NULL; pg = NULL;
while ((i = pseg_set(pm, va, tte.data.data, pg)) == 1) { while ((i = pseg_set(pm, va, tte.data.data, pg)) == 1) {
pg = NULL; pg = NULL;
if (pmap_initialized || !uvm_page_physget(&pg)) { if (uvm.page_init_done || !uvm_page_physget(&pg)) {
vm_page_t page; vm_page_t page;
#ifdef NOTDEF_DEBUG #ifdef NOTDEF_DEBUG
printf("pmap_kenter_pa: need to alloc page\n"); printf("pmap_kenter_pa: need to alloc page\n");
@ -2166,7 +2161,7 @@ pmap_enter(pm, va, pa, prot, flags)
#endif #endif
while (pseg_set(pm, va, tte.data.data, pg) == 1) { while (pseg_set(pm, va, tte.data.data, pg) == 1) {
pg = NULL; pg = NULL;
if (pmap_initialized || !uvm_page_physget(&pg)) { if (uvm.page_init_done || !uvm_page_physget(&pg)) {
vm_page_t page; vm_page_t page;
#ifdef NOTDEF_DEBUG #ifdef NOTDEF_DEBUG
printf("pmap_enter: need to alloc page\n"); printf("pmap_enter: need to alloc page\n");