Re: bug in vm_contig.c? [was: Re: ACPI crash with recent changes]

From: Alan L. Cox <alc_at_imimic.com>
Date: Thu, 04 Mar 2004 21:28:56 -0600
Please test the attached patch instead.  In order to avoid a race 
condition, it is necessary for the loop to begin with "start" rather 
than "start + 1".  What is both unnecessary and wrong is the physical 
contiguity check.  (My bad. :-()  In other words, the test that the page 
is still free must be repeated because of the dropping of the free page 
queue lock, but contiguity once true is always true.

Regards,
Alan


Index: vm/vm_contig.c
===================================================================
RCS file: /home/ncvs/src/sys/vm/vm_contig.c,v
retrieving revision 1.31
diff -u -r1.31 vm_contig.c
--- vm/vm_contig.c	2 Mar 2004 08:25:58 -0000	1.31
+++ vm/vm_contig.c	5 Mar 2004 03:08:17 -0000
_at__at_ -232,9 +232,7 _at__at_
 		mtx_lock_spin(&vm_page_queue_free_mtx);
 		for (i = start; i < (start + size / PAGE_SIZE); i++) {
 			pqtype = pga[i].queue - pga[i].pc;
-			if ((VM_PAGE_TO_PHYS(&pga[i]) !=
-			    (VM_PAGE_TO_PHYS(&pga[i - 1]) + PAGE_SIZE)) ||
-			    (pqtype != PQ_FREE)) {
+			if (pqtype != PQ_FREE) {
 				start++;
 				goto again;
 			}
Received on Thu Mar 04 2004 - 18:28:57 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:46 UTC