Allocate kernel page table object (kptobj) before any kmem_alloc calls.

On a system with a large amount of ram (e.g. 2G), allocation of per-page
data structures (512K physical pages) could easily bust the initial kernel
page table (36M), and growth of kernel page table requires kptobj.
This commit is contained in:
Luoqi Chen 1999-01-08 14:20:54 +00:00
parent 2c9619f2a6
commit fcf37ac337
2 changed files with 12 additions and 10 deletions

View File

@ -39,7 +39,7 @@
* SUCH DAMAGE.
*
* from: @(#)pmap.c 7.7 (Berkeley) 5/12/91
* $Id: pmap.c,v 1.215 1998/12/07 21:58:18 archie Exp $
* $Id: pmap.c,v 1.216 1999/01/07 22:15:51 dt Exp $
*/
/*
@ -605,6 +605,11 @@ pmap_init(phys_start, phys_end)
int i;
int initial_pvs;
/*
* object for kernel page table pages
*/
kptobj = vm_object_allocate(OBJT_DEFAULT, NKPDE);
/*
* calculate the number of pv_entries needed
*/
@ -639,10 +644,6 @@ pmap_init(phys_start, phys_end)
pvinit = (struct pv_entry *) kmem_alloc(kernel_map,
initial_pvs * sizeof (struct pv_entry));
zbootinit(pvzone, "PV ENTRY", sizeof (struct pv_entry), pvinit, pv_npg);
/*
* object for kernel page table pages
*/
kptobj = vm_object_allocate(OBJT_DEFAULT, NKPDE);
/*
* Now it is safe to enable pv_table recording.

View File

@ -39,7 +39,7 @@
* SUCH DAMAGE.
*
* from: @(#)pmap.c 7.7 (Berkeley) 5/12/91
* $Id: pmap.c,v 1.215 1998/12/07 21:58:18 archie Exp $
* $Id: pmap.c,v 1.216 1999/01/07 22:15:51 dt Exp $
*/
/*
@ -605,6 +605,11 @@ pmap_init(phys_start, phys_end)
int i;
int initial_pvs;
/*
* object for kernel page table pages
*/
kptobj = vm_object_allocate(OBJT_DEFAULT, NKPDE);
/*
* calculate the number of pv_entries needed
*/
@ -639,10 +644,6 @@ pmap_init(phys_start, phys_end)
pvinit = (struct pv_entry *) kmem_alloc(kernel_map,
initial_pvs * sizeof (struct pv_entry));
zbootinit(pvzone, "PV ENTRY", sizeof (struct pv_entry), pvinit, pv_npg);
/*
* object for kernel page table pages
*/
kptobj = vm_object_allocate(OBJT_DEFAULT, NKPDE);
/*
* Now it is safe to enable pv_table recording.