diff options
author | Michael Shalayeff <mickey@cvs.openbsd.org> | 2003-10-31 21:24:20 +0000 |
---|---|---|
committer | Michael Shalayeff <mickey@cvs.openbsd.org> | 2003-10-31 21:24:20 +0000 |
commit | bfa4f49bb81ea7e32162e523b46c0b88238799c2 (patch) | |
tree | 735c97c2723b6b74c3f2bd5991eb6e68e18126f5 /sys/arch | |
parent | d9a96b2321d13ba3cae279a85bdfb1d0ad7690fe (diff) |
allocate initial pdes for the kmem proportional to the totalphysmem to allow large memory sizes and also more verbose diagnostic message in pmap_destroy()
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/hppa/hppa/pmap.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/sys/arch/hppa/hppa/pmap.c b/sys/arch/hppa/hppa/pmap.c index a5867bd44ea..e406f0632d4 100644 --- a/sys/arch/hppa/hppa/pmap.c +++ b/sys/arch/hppa/hppa/pmap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.c,v 1.102 2003/05/07 21:50:43 mickey Exp $ */ +/* $OpenBSD: pmap.c,v 1.103 2003/10/31 21:24:19 mickey Exp $ */ /* * Copyright (c) 1998-2003 Michael Shalayeff @@ -438,7 +438,7 @@ pmap_bootstrap(vstart) struct vp_entry *hptp; #endif struct pmap *kpm; - int npdes; + int npdes, nkpdes; DPRINTF(PDB_FOLLOW|PDB_INIT, ("pmap_bootstrap(0x%x)\n", vstart)); @@ -539,8 +539,9 @@ pmap_bootstrap(vstart) * lazy map only needed pieces (see bus_mem_add_mapping() for refs). */ - /* four more for the the kernel virtual */ - npdes = 4 + (totalphysmem + btoc(PDE_SIZE) - 1) / btoc(PDE_SIZE); + /* takes about 16 per gig of initial kmem */ + nkpdes = (totalphysmem >> 14); + npdes = nkpdes + (totalphysmem + btoc(PDE_SIZE) - 1) / btoc(PDE_SIZE); uvm_page_physload(0, totalphysmem, atop(addr) + npdes, totalphysmem, VM_FREELIST_DEFAULT); @@ -548,7 +549,7 @@ pmap_bootstrap(vstart) for (va = 0; npdes--; va += PDE_SIZE, addr += PAGE_SIZE) { /* last four pdes are for the kernel virtual */ - if (npdes == 3) + if (npdes == nkpdes - 1) va = SYSCALLGATE; /* now map the pde for the physmem */ bzero((void *)addr, PAGE_SIZE); @@ -666,8 +667,8 @@ pmap_destroy(pmap) #ifdef DIAGNOSTIC while ((pg = TAILQ_FIRST(&pmap->pm_obj.memq))) { - printf("pmap_destroy: unaccounted ptp 0x%x\n", - VM_PAGE_TO_PHYS(pg)); + printf("pmap_destroy: unaccounted ptp 0x%x count %d\n", + VM_PAGE_TO_PHYS(pg), pg->wire_count); if (pg->flags & PG_BUSY) panic("pmap_destroy: busy page table page"); pg->wire_count = 0; |