Construct the free queue(s) in descending order (by physical

address) so that the first 16MB of physical memory is allocated
last rather than first.  On large-memory machines, this avoids
the exhaustion of low physical memory before isa_dmainit has run.
This commit is contained in:
alc 1999-03-19 05:21:03 +00:00
parent 3d3f9f8b88
commit 4bdf1d66da

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)vm_page.c 7.4 (Berkeley) 5/7/91
* $Id: vm_page.c,v 1.126 1999/02/15 06:52:14 dillon Exp $
* $Id: vm_page.c,v 1.127 1999/02/24 21:26:26 dillon Exp $
*/
/*
@ -322,6 +322,12 @@ vm_page_startup(starta, enda, vaddr)
bzero((caddr_t) vm_page_array, page_range * sizeof(struct vm_page));
vm_page_array_size = page_range;
/*
* Construct the free queue(s) in descending order (by physical
* address) so that the first 16MB of physical memory is allocated
* last rather than first. On large-memory machines, this avoids
* the exhaustion of low physical memory before isa_dmainit has run.
*/
cnt.v_page_count = 0;
cnt.v_free_count = 0;
for (i = 0; phys_avail[i + 1] && npages > 0; i += 2) {
@ -337,7 +343,7 @@ vm_page_startup(starta, enda, vaddr)
m->flags = 0;
m->pc = (pa >> PAGE_SHIFT) & PQ_L2_MASK;
m->queue = m->pc + PQ_FREE;
TAILQ_INSERT_TAIL(vm_page_queues[m->queue].pl, m, pageq);
TAILQ_INSERT_HEAD(vm_page_queues[m->queue].pl, m, pageq);
++(*vm_page_queues[m->queue].lcnt);
pa += PAGE_SIZE;
}