Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 25 May 2007 19:58:01 GMT
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 120398 for review
Message-ID:  <200705251958.l4PJw107021625@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=120398

Change 120398 by hselasky@hselasky_mini_itx on 2007/05/25 19:57:40

	Fix a showstopper or panic source in vm_contig.c.

Affected files ...

.. //depot/projects/usb/src/sys/vm/vm_contig.c#6 edit

Differences ...

==== //depot/projects/usb/src/sys/vm/vm_contig.c#6 (text+ko) ====

@@ -400,7 +400,10 @@
 	static vm_pindex_t np = 0;
 	static vm_pindex_t start = 0;
 	vm_pindex_t startl = 0;
- 	int i, pass, pqtype;
+	vm_pindex_t temp;
+ 	int i, pqtype;
+	uint8_t pass;
+	uint8_t j;
 
 	size = npages << PAGE_SHIFT;
 	if (size == 0)
@@ -485,7 +488,18 @@
 			    pqtype != PQ_CACHE) {
 				if (m->queue == PQ_ACTIVE ||
 				    m->queue == PQ_INACTIVE) {
-					if (vm_contig_launder_page(m) != 0)
+					/* NOTE: The function
+					 * "vm_config_launder_page()"
+					 * can sleep. To ensure that
+					 * this function operates
+					 * coherently we need to
+					 * suspend/resume the "start"
+					 * variable:
+					 */
+					temp = start;
+					j = vm_contig_launder_page(m) ? 1 : 0;
+					start = temp;
+					if (j) 
 						goto cleanup_freed;
 					pqtype = m->queue - m->pc;
 					if (pqtype != PQ_FREE &&
@@ -520,7 +534,7 @@
 				goto retry_page;
 		}
 		/*
-		 * We've found a contiguous chunk that meets are requirements.
+		 * We've found a contiguous chunk that meets our requirements.
 		 */
 		np = npages;
 		startl = start;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200705251958.l4PJw107021625>