Source-Changes-HG archive

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

[src/netbsd-1-5]: src/sys/uvm Pull up rev. 1.51:



details:   https://anonhg.NetBSD.org/src/rev/27730608dbb9
branches:  netbsd-1-5
changeset: 488913:27730608dbb9
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Sun Aug 06 17:12:09 2000 +0000

description:
Pull up rev. 1.51:
Update a comment in uvmfault_anonget() to reflect reality, and
make uvm_fault() handle uvmfault_anonget() failure properly (i.e.
don't unlock a lock that's already unlocked).

diffstat:

 sys/uvm/uvm_fault.c |  34 +++++++++++++++++++++-------------
 1 files changed, 21 insertions(+), 13 deletions(-)

diffs (67 lines):

diff -r 87034b1846df -r 27730608dbb9 sys/uvm/uvm_fault.c
--- a/sys/uvm/uvm_fault.c       Sun Aug 06 17:09:58 2000 +0000
+++ b/sys/uvm/uvm_fault.c       Sun Aug 06 17:12:09 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uvm_fault.c,v 1.48 2000/04/10 01:17:41 thorpej Exp $   */
+/*     $NetBSD: uvm_fault.c,v 1.48.4.1 2000/08/06 17:12:09 thorpej Exp $       */
 
 /*
  *
@@ -281,7 +281,7 @@
  * page in that anon.
  *
  * => maps, amap, and anon locked by caller.
- * => if we fail (result != VM_PAGER_OK) we unlock everything except anon.
+ * => if we fail (result != VM_PAGER_OK) we unlock everything.
  * => if we are successful, we return with everything still locked.
  * => we don't move the page on the queues [gets moved later]
  * => if we allocate a new page [we_own], it gets put on the queues.
@@ -1067,7 +1067,7 @@
 
        /*
         * let uvmfault_anonget do the dirty work.
-        * if it fails (!OK) it will unlock all but the anon for us.
+        * if it fails (!OK) it will unlock everything for us.
         * if it succeeds, locks are still valid and locked.
         * also, if it is OK, then the anon's page is on the queues.
         * if the page is on loan from a uvm_object, then anonget will
@@ -1075,21 +1075,29 @@
         */
 
        result = uvmfault_anonget(&ufi, amap, anon);
-       if (result != VM_PAGER_OK) {
-               simple_unlock(&anon->an_lock);
-       }
+       switch (result) {
+       case VM_PAGER_OK:
+               break; 
 
-       if (result == VM_PAGER_REFAULT)
+       case VM_PAGER_REFAULT:
                goto ReFault;
 
-       if (result == VM_PAGER_AGAIN) {
-               tsleep((caddr_t)&lbolt, PVM, "fltagain1", 0);
-               goto ReFault;
+       case VM_PAGER_ERROR:
+               /*
+                * An error occurred while trying to bring in the
+                * page -- this is the only error we return right
+                * now.
+                */
+               return (KERN_PROTECTION_FAILURE);       /* XXX */
+
+       default:
+#ifdef DIAGNOSTIC
+               panic("uvm_fault: uvmfault_anonget -> %d", result);
+#else
+               return (KERN_PROTECTION_FAILURE);
+#endif
        }
 
-       if (result != VM_PAGER_OK)
-               return (KERN_PROTECTION_FAILURE);               /* XXX??? */
-
        /*
         * uobj is non null if the page is on loan from an object (i.e. uobj)
         */



Home | Main Index | Thread Index | Old Index