diff options
author | dyson <dyson@FreeBSD.org> | 1996-10-06 18:27:39 +0000 |
---|---|---|
committer | dyson <dyson@FreeBSD.org> | 1996-10-06 18:27:39 +0000 |
commit | 38f3ce75b7004c684ab874c3c65cf573d1df8220 (patch) | |
tree | b10b534ef036cc5e52296aac4aa1099943ad9cb3 /sys/vm | |
parent | 470307b7785d3d03dc30073c3d4aec75051736dc (diff) | |
download | FreeBSD-src-38f3ce75b7004c684ab874c3c65cf573d1df8220.zip FreeBSD-src-38f3ce75b7004c684ab874c3c65cf573d1df8220.tar.gz |
Fix a problem with the page coloring code that the system will not always
be able to use all of the free pages. This can manifest as a panic
using DIAGNOSTIC, or as a panic on an indirect memory reference.
Diffstat (limited to 'sys/vm')
-rw-r--r-- | sys/vm/vm_page.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index ef68951..25a12b0 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.65 1996/09/28 03:33:35 dyson Exp $ + * $Id: vm_page.c,v 1.66 1996/09/28 17:53:18 bde Exp $ */ /* @@ -601,7 +601,7 @@ vm_page_list_find(basequeue, index) for(j = 0; j < PQ_L1_SIZE; j++) { for(i = (PQ_L2_SIZE/2) - (PQ_L1_SIZE - 1); - i > 0; + i >= 0; i -= PQ_L1_SIZE) { hindex = (index + (i+j)) & PQ_L2_MASK; m = TAILQ_FIRST(vm_page_queues[basequeue + hindex].pl); @@ -690,7 +690,7 @@ vm_page_select_free(object, pindex, prefqueue) */ for(j = 0; j < PQ_L1_SIZE; j++) { for(i = (PQ_L2_SIZE/2) - (PQ_L1_SIZE - 1); - (i + j) > 0; + (i + j) >= 0; i -= PQ_L1_SIZE) { hindex = prefqueue + ((index + (i+j)) & PQ_L2_MASK); @@ -823,6 +823,10 @@ vm_page_alloc(object, pindex, page_req) case VM_ALLOC_INTERRUPT: if (cnt.v_free_count > 0) { m = vm_page_select_free(object, pindex, PQ_FREE); +#if defined(DIAGNOSTIC) + if (m == NULL) + panic("vm_page_alloc(INTERRUPT): missing page on free queue\n"); +#endif } else { splx(s); pagedaemon_wakeup(); |