Date: Thu, 04 Mar 2004 21:28:56 -0600 From: "Alan L. Cox" <alc@imimic.com> To: Marcel Moolenaar <marcel@xcllnt.net> Cc: Nate Lawson <nate@root.org> Subject: Re: bug in vm_contig.c? [was: Re: ACPI crash with recent changes] Message-ID: <4047F3F8.1080207@imimic.com> In-Reply-To: <20040305025524.GA601@dhcp01.pn.xcllnt.net> References: <20040304025223.GA622@dhcp01.pn.xcllnt.net> <20040304161108.U26303@root.org> <20040305025524.GA601@dhcp01.pn.xcllnt.net>
next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------050901050509040204060304
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
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
--------------050901050509040204060304
Content-Type: text/plain;
name="vm_contig.c-bug-fix"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="vm_contig.c-bug-fix"
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
@@ -232,9 +232,7 @@
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;
}
--------------050901050509040204060304--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4047F3F8.1080207>
