assertions yamt-pagecache
authoryamt <yamt@NetBSD.org>
Mon, 14 Nov 2011 14:23:16 +0000
branchyamt-pagecache
changeset 280316 1c334e6a72c6
parent 280315 17af9b199273
child 280317 fc28213d041b
assertions
sys/uvm/uvm_fault.c
--- a/sys/uvm/uvm_fault.c	Mon Nov 14 14:22:28 2011 +0000
+++ b/sys/uvm/uvm_fault.c	Mon Nov 14 14:23:16 2011 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_fault.c,v 1.190.2.1 2011/11/02 21:54:00 yamt Exp $	*/
+/*	$NetBSD: uvm_fault.c,v 1.190.2.2 2011/11/14 14:23:16 yamt Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_fault.c,v 1.190.2.1 2011/11/02 21:54:00 yamt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_fault.c,v 1.190.2.2 2011/11/14 14:23:16 yamt Exp $");
 
 #include "opt_uvmhist.h"
 
@@ -1186,7 +1186,10 @@
 	UVMHIST_FUNC("uvm_fault_upper_neighbor"); UVMHIST_CALLED(maphist);
 
 	/* locked: amap, anon */
-
+	KASSERT(pg->uobject == NULL);
+	KASSERT(pg->uanon != NULL);
+	KASSERT(mutex_owned(pg->uanon->an_lock));
+	KASSERT(uvm_pagegetdirty(pg) != UVM_PAGE_STATUS_CLEAN);
 	mutex_enter(&uvm_pageqlock);
 	uvm_pageenqueue(pg);
 	mutex_exit(&uvm_pageqlock);
@@ -1462,6 +1465,7 @@
 	KASSERT(anon->an_lock == amap->am_lock);
 	KASSERT(oanon->an_lock == amap->am_lock);
 	KASSERT(uobj == NULL || mutex_owned(uobj->vmobjlock));
+	KASSERT(uvm_pagegetdirty(pg) != UVM_PAGE_STATUS_CLEAN);
 
 	/*
 	 * now map the page in.