diff options
author | alc <alc@FreeBSD.org> | 1999-03-19 05:21:03 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 1999-03-19 05:21:03 +0000 |
commit | 4bdf1d66da6e7b3d4639a74583b97824c684cb2e (patch) | |
tree | 6ec156468d3b85d98d8e16da21c99401551b8839 /sys/vm | |
parent | 3d3f9f8b88a6f35e56317986d563ef949d168ce6 (diff) | |
download | FreeBSD-src-4bdf1d66da6e7b3d4639a74583b97824c684cb2e.zip FreeBSD-src-4bdf1d66da6e7b3d4639a74583b97824c684cb2e.tar.gz |
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.
Diffstat (limited to 'sys/vm')
-rw-r--r-- | sys/vm/vm_page.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index a2e3a83..1cadc5b 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; } |