Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 27 Sep 2015 01:35:33 +0000 (UTC)
From:      Alan Cox <alc@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r288288 - stable/10/sys/vm
Message-ID:  <201509270135.t8R1ZXEd000101@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: alc
Date: Sun Sep 27 01:35:32 2015
New Revision: 288288
URL: https://svnweb.freebsd.org/changeset/base/288288

Log:
  MFC r287121
    Testing whether a page is dirty does not require the page lock.

Modified:
  stable/10/sys/vm/vm_pageout.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/vm/vm_pageout.c
==============================================================================
--- stable/10/sys/vm/vm_pageout.c	Sun Sep 27 01:33:43 2015	(r288287)
+++ stable/10/sys/vm/vm_pageout.c	Sun Sep 27 01:35:32 2015	(r288288)
@@ -408,10 +408,13 @@ more:
 			ib = 0;
 			break;
 		}
-		vm_page_lock(p);
 		vm_page_test_dirty(p);
-		if (p->dirty == 0 ||
-		    p->queue != PQ_INACTIVE ||
+		if (p->dirty == 0) {
+			ib = 0;
+			break;
+		}
+		vm_page_lock(p);
+		if (p->queue != PQ_INACTIVE ||
 		    p->hold_count != 0) {	/* may be undergoing I/O */
 			vm_page_unlock(p);
 			ib = 0;
@@ -435,10 +438,11 @@ more:
 
 		if ((p = vm_page_next(ps)) == NULL || vm_page_busied(p))
 			break;
-		vm_page_lock(p);
 		vm_page_test_dirty(p);
-		if (p->dirty == 0 ||
-		    p->queue != PQ_INACTIVE ||
+		if (p->dirty == 0)
+			break;
+		vm_page_lock(p);
+		if (p->queue != PQ_INACTIVE ||
 		    p->hold_count != 0) {	/* may be undergoing I/O */
 			vm_page_unlock(p);
 			break;



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