mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-29 16:44:03 +00:00
In FreeBSD 7.0 and beyond, pmap_growkernel() should pass VM_ALLOC_INTERRUPT
to vm_page_alloc() instead of VM_ALLOC_SYSTEM. VM_ALLOC_SYSTEM was the logical choice before FreeBSD 7.0 because VM_ALLOC_INTERRUPT could not reclaim a cached page. Simply put, there was no ordering between VM_ALLOC_INTERRUPT and VM_ALLOC_SYSTEM as to which "dug deeper" into the cache and free queues. Now, there is; VM_ALLOC_INTERRUPT dominates VM_ALLOC_SYSTEM. While I'm here, teach pmap_growkernel() to request a prezeroed page. MFC after: 1 week
This commit is contained in:
parent
688fe74d0c
commit
cc82a18b88
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=180352
@ -1724,10 +1724,12 @@ pmap_growkernel(vm_offset_t addr)
|
||||
if (pde == NULL) {
|
||||
/* We need a new PDP entry */
|
||||
nkpg = vm_page_alloc(NULL, kernel_vm_end >> PDPSHIFT,
|
||||
VM_ALLOC_NOOBJ | VM_ALLOC_SYSTEM | VM_ALLOC_WIRED);
|
||||
VM_ALLOC_INTERRUPT | VM_ALLOC_NOOBJ |
|
||||
VM_ALLOC_WIRED | VM_ALLOC_ZERO);
|
||||
if (nkpg == NULL)
|
||||
panic("pmap_growkernel: no memory to grow kernel");
|
||||
pmap_zero_page(nkpg);
|
||||
if ((nkpg->flags & PG_ZERO) == 0)
|
||||
pmap_zero_page(nkpg);
|
||||
paddr = VM_PAGE_TO_PHYS(nkpg);
|
||||
newpdp = (pdp_entry_t)
|
||||
(paddr | PG_V | PG_RW | PG_A | PG_M);
|
||||
@ -1744,10 +1746,12 @@ pmap_growkernel(vm_offset_t addr)
|
||||
}
|
||||
|
||||
nkpg = vm_page_alloc(NULL, pmap_pde_pindex(kernel_vm_end),
|
||||
VM_ALLOC_NOOBJ | VM_ALLOC_SYSTEM | VM_ALLOC_WIRED);
|
||||
VM_ALLOC_INTERRUPT | VM_ALLOC_NOOBJ | VM_ALLOC_WIRED |
|
||||
VM_ALLOC_ZERO);
|
||||
if (nkpg == NULL)
|
||||
panic("pmap_growkernel: no memory to grow kernel");
|
||||
pmap_zero_page(nkpg);
|
||||
if ((nkpg->flags & PG_ZERO) == 0)
|
||||
pmap_zero_page(nkpg);
|
||||
paddr = VM_PAGE_TO_PHYS(nkpg);
|
||||
newpdir = (pd_entry_t) (paddr | PG_V | PG_RW | PG_A | PG_M);
|
||||
*pmap_pde(kernel_pmap, kernel_vm_end) = newpdir;
|
||||
|
@ -1806,13 +1806,15 @@ pmap_growkernel(vm_offset_t addr)
|
||||
}
|
||||
|
||||
nkpg = vm_page_alloc(NULL, kernel_vm_end >> PDRSHIFT,
|
||||
VM_ALLOC_NOOBJ | VM_ALLOC_SYSTEM | VM_ALLOC_WIRED);
|
||||
VM_ALLOC_INTERRUPT | VM_ALLOC_NOOBJ | VM_ALLOC_WIRED |
|
||||
VM_ALLOC_ZERO);
|
||||
if (nkpg == NULL)
|
||||
panic("pmap_growkernel: no memory to grow kernel");
|
||||
|
||||
nkpt++;
|
||||
|
||||
pmap_zero_page(nkpg);
|
||||
if ((nkpg->flags & PG_ZERO) == 0)
|
||||
pmap_zero_page(nkpg);
|
||||
ptppaddr = VM_PAGE_TO_PHYS(nkpg);
|
||||
newpdir = (pd_entry_t) (ptppaddr | PG_V | PG_RW | PG_A | PG_M);
|
||||
pdir_pde(PTD, kernel_vm_end) = newpdir;
|
||||
|
Loading…
Reference in New Issue
Block a user