From 61fc5ee627da1291f0886657272a68cb662b5f4b Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Fri, 19 Mar 1999 05:21:03 +0000 Subject: 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. --- sys/vm/vm_page.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'sys/vm/vm_page.c') diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index a2e3a8304658..1cadc5b66d45 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -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; } -- cgit v1.2.3