Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/yamt-pagecache]: src/sys/uvm assertions



details:   https://anonhg.NetBSD.org/src/rev/c4f52d3483c8
branches:  yamt-pagecache
changeset: 770831:c4f52d3483c8
user:      yamt <yamt%NetBSD.org@localhost>
date:      Mon Nov 14 14:23:16 2011 +0000

description:
assertions

diffstat:

 sys/uvm/uvm_fault.c |  10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diffs (38 lines):

diff -r 1f764a1892f9 -r c4f52d3483c8 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.



Home | Main Index | Thread Index | Old Index