O->A loan related statistics fixes. yamt-pagecache
authoryamt <yamt@NetBSD.org>
Wed, 04 Jan 2012 16:31:17 +0000
branchyamt-pagecache
changeset 280341 74022273ec6d
parent 280340 8719e186985b
child 280342 a1a28321e5ef
O->A loan related statistics fixes.
sys/uvm/uvm_loan.c
sys/uvm/uvm_page.c
--- a/sys/uvm/uvm_loan.c	Wed Jan 04 16:30:06 2012 +0000
+++ b/sys/uvm/uvm_loan.c	Wed Jan 04 16:31:17 2012 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_loan.c,v 1.81.2.8 2011/12/28 13:24:19 yamt Exp $	*/
+/*	$NetBSD: uvm_loan.c,v 1.81.2.9 2012/01/04 16:31:17 yamt Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_loan.c,v 1.81.2.8 2011/12/28 13:24:19 yamt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_loan.c,v 1.81.2.9 2012/01/04 16:31:17 yamt Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1755,6 +1755,7 @@
 		return;
 	}
 	KASSERT(pg->loan_count > 0);
+	uvm_pagemarkdirty(pg, UVM_PAGE_STATUS_DIRTY);
 	if (!pageqlocked) {
 		mutex_enter(&uvm_pageqlock);
 	}
@@ -1770,7 +1771,6 @@
 	 * the pagestate should have been decremented when uobj dropped the
 	 * ownership.
 	 */
-	uvm_pagemarkdirty(pg, UVM_PAGE_STATUS_DIRTY);
 	ucpu = uvm_cpu_get();
 	ucpu->loan_resolve_orphan++;
 	ucpu->pagestate[1][UVM_PAGE_STATUS_DIRTY]++;
--- a/sys/uvm/uvm_page.c	Wed Jan 04 16:30:06 2012 +0000
+++ b/sys/uvm/uvm_page.c	Wed Jan 04 16:31:17 2012 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_page.c,v 1.178.2.11 2012/01/04 16:30:06 yamt Exp $	*/
+/*	$NetBSD: uvm_page.c,v 1.178.2.12 2012/01/04 16:31:17 yamt Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -66,7 +66,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.178.2.11 2012/01/04 16:30:06 yamt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.178.2.12 2012/01/04 16:31:17 yamt Exp $");
 
 #include "opt_ddb.h"
 #include "opt_uvmhist.h"
@@ -1524,15 +1524,13 @@
 		 * if the page is owned by an anon then we just want to
 		 * drop anon ownership.  the kernel will free the page when
 		 * it is done with it.  if the page is owned by an object,
-		 * remove it from the object and mark it dirty for the benefit
-		 * of possible anon owners.
+		 * remove it from the object.
 		 *
 		 * regardless of previous ownership, wakeup any waiters,
 		 * unbusy the page, and we're done.
 		 */
 
 		if (obj != NULL) {
-			uvm_pagemarkdirty(pg, UVM_PAGE_STATUS_DIRTY);
 			uvm_pageremove(obj, pg);
 			pg->pqflags &= ~(PQ_FILE|PQ_AOBJ);
 		} else if (pg->uanon != NULL) {