aboutsummaryrefslogtreecommitdiff
path: root/sys/vm/vm_page.c
diff options
context:
space:
mode:
authorAlan Cox <alc@FreeBSD.org>1999-03-19 05:21:03 +0000
committerAlan Cox <alc@FreeBSD.org>1999-03-19 05:21:03 +0000
commit61fc5ee627da1291f0886657272a68cb662b5f4b (patch)
tree2c45cb60d35ab53d9cb9339d36d593719b69351d /sys/vm/vm_page.c
parent24a6ccfc38d8aa0b1bd4e7333803dcd71cae33ab (diff)
downloadsrc-61fc5ee627da1291f0886657272a68cb662b5f4b.tar.gz
src-61fc5ee627da1291f0886657272a68cb662b5f4b.zip
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.
Notes
Notes: svn path=/head/; revision=44880
Diffstat (limited to 'sys/vm/vm_page.c')
-rw-r--r--sys/vm/vm_page.c10
1 files changed, 8 insertions, 2 deletions
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;
}