Source-Changes-HG archive

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

[src/rmind-uvmplock]: src/sys/uvm uvm_fault_lower_promote: fix assert (move a...



details:   https://anonhg.NetBSD.org/src/rev/c3792b9b4db4
branches:  rmind-uvmplock
changeset: 753088:c3792b9b4db4
user:      rmind <rmind%NetBSD.org@localhost>
date:      Sat May 21 21:26:48 2011 +0000

description:
uvm_fault_lower_promote: fix assert (move a bit up, where logic applies).

diffstat:

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

diffs (55 lines):

diff -r 01df5c8e2599 -r c3792b9b4db4 sys/uvm/uvm_fault.c
--- a/sys/uvm/uvm_fault.c       Sat May 21 03:39:17 2011 +0000
+++ b/sys/uvm/uvm_fault.c       Sat May 21 21:26:48 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uvm_fault.c,v 1.173.2.7 2011/05/19 03:43:05 rmind Exp $        */
+/*     $NetBSD: uvm_fault.c,v 1.173.2.8 2011/05/21 21:26:48 rmind 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.173.2.7 2011/05/19 03:43:05 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_fault.c,v 1.173.2.8 2011/05/21 21:26:48 rmind Exp $");
 
 #include "opt_uvmhist.h"
 
@@ -2039,14 +2039,12 @@
        int error;
        UVMHIST_FUNC("uvm_fault_lower_promote"); UVMHIST_CALLED(maphist);
 
+       KASSERT(amap != NULL);
+
        /*
-        * if we are going to promote the data to an anon we
+        * If we are going to promote the data to an anon we
         * allocate a blank anon here and plug it into our amap.
         */
-#if DIAGNOSTIC
-       if (amap == NULL)
-               panic("uvm_fault: want to promote data, but no anon");
-#endif
        error = uvmfault_promote(ufi, NULL, uobjpage,
            &anon, &flt->anon_spare);
        switch (error) {
@@ -2061,8 +2059,9 @@
        pg = anon->an_page;
 
        /*
-        * fill in the data
+        * Fill in the data.
         */
+       KASSERT(uobj == NULL || (uobjpage->flags & PG_BUSY) != 0);
 
        if (uobjpage != PGO_DONTCARE) {
                uvmexp.flt_prcopy++;
@@ -2107,7 +2106,6 @@
                    anon, pg, 0, 0);
        }
 
-       KASSERT(uobj == NULL || (uobjpage->flags & PG_BUSY) != 0);
        return uvm_fault_lower_enter(ufi, flt, uobj, anon, pg);
 }
 



Home | Main Index | Thread Index | Old Index