Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 11 May 2009 05:16:57 +0000 (UTC)
From:      Alan Cox <alc@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r191986 - head/sys/kern
Message-ID:  <200905110516.n4B5Gv7O078608@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: alc
Date: Mon May 11 05:16:57 2009
New Revision: 191986
URL: http://svn.freebsd.org/changeset/base/191986

Log:
  Revert CVS revision 1.94 (svn r16840).  Current pmap implementations don't
  suffer from the race condition that motivated revision 1.94.  Consequently,
  the work-around that was implemented by revision 1.94 is no longer needed.
  Moreover, reverting this work-around eliminates the need for
  vfs_busy_pages() to acquire the page queues lock when preparing a buffer
  for read.
  
  Reviewed by:	tegge

Modified:
  head/sys/kern/vfs_bio.c

Modified: head/sys/kern/vfs_bio.c
==============================================================================
--- head/sys/kern/vfs_bio.c	Mon May 11 04:57:40 2009	(r191985)
+++ head/sys/kern/vfs_bio.c	Mon May 11 05:16:57 2009	(r191986)
@@ -3519,7 +3519,8 @@ retry:
 			goto retry;
 	}
 	bogus = 0;
-	vm_page_lock_queues();
+	if (clear_modify)
+		vm_page_lock_queues();
 	for (i = 0; i < bp->b_npages; i++) {
 		m = bp->b_pages[i];
 
@@ -3542,17 +3543,18 @@ retry:
 		 * It may not work properly with small-block devices.
 		 * We need to find a better way.
 		 */
-		pmap_remove_all(m);
-		if (clear_modify)
+		if (clear_modify) {
+			pmap_remove_write(m);
 			vfs_page_set_valid(bp, foff, m);
-		else if (m->valid == VM_PAGE_BITS_ALL &&
+		} else if (m->valid == VM_PAGE_BITS_ALL &&
 		    (bp->b_flags & B_CACHE) == 0) {
 			bp->b_pages[i] = bogus_page;
 			bogus++;
 		}
 		foff = (foff + PAGE_SIZE) & ~(off_t)PAGE_MASK;
 	}
-	vm_page_unlock_queues();
+	if (clear_modify)
+		vm_page_unlock_queues();
 	VM_OBJECT_UNLOCK(obj);
 	if (bogus)
 		pmap_qenter(trunc_page((vm_offset_t)bp->b_data),



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