Source-Changes-HG archive

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

[src/trunk]: src/sys/uvm uvm_loanzero:



details:   https://anonhg.NetBSD.org/src/rev/259d9fa37353
branches:  trunk
changeset: 554367:259d9fa37353
user:      yamt <yamt%NetBSD.org@localhost>
date:      Mon Oct 27 12:47:33 2003 +0000

description:
uvm_loanzero:
- after sleeping for memory, re-check if we have a page.
- put the allocated page to pageq to appease UVM_PAGE_TRKOWN.
- dequeue the page when doing ->K loan.

diffstat:

 sys/uvm/uvm_loan.c |  11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diffs (50 lines):

diff -r b64f5f91955f -r 259d9fa37353 sys/uvm/uvm_loan.c
--- a/sys/uvm/uvm_loan.c        Mon Oct 27 10:13:48 2003 +0000
+++ b/sys/uvm/uvm_loan.c        Mon Oct 27 12:47:33 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uvm_loan.c,v 1.43 2003/10/26 16:04:00 yamt Exp $       */
+/*     $NetBSD: uvm_loan.c,v 1.44 2003/10/27 12:47:33 yamt Exp $       */
 
 /*
  *
@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_loan.c,v 1.43 2003/10/26 16:04:00 yamt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_loan.c,v 1.44 2003/10/27 12:47:33 yamt Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -667,6 +667,7 @@
        struct uvm_object *uobj = ufi->entry->object.uvm_obj;
        struct vm_amap *amap = ufi->entry->aref.ar_amap;
 
+again:
        simple_lock(&uvm_loanzero_object.vmobjlock);
 
        /*
@@ -689,18 +690,22 @@
                        if (uobj) {
                                simple_lock(&uobj->vmobjlock);
                        }
-                       simple_lock(&uvm_loanzero_object.vmobjlock);
+                       goto again;
                }
 
                /* got a zero'd page. */
                pg->flags &= ~(PG_WANTED|PG_BUSY|PG_FAKE);
                pg->flags |= PG_RDONLY;
+               uvm_lock_pageq();
+               uvm_pageactivate(pg);
+               uvm_unlock_pageq();
                UVM_PAGE_OWN(pg, NULL);
        }
 
        if ((flags & UVM_LOAN_TOANON) == 0) {   /* loaning to kernel-page */
                uvm_lock_pageq();
                pg->loan_count++;
+               uvm_pagedequeue(pg);
                uvm_unlock_pageq();
                simple_unlock(&uvm_loanzero_object.vmobjlock);
                **output = pg;



Home | Main Index | Thread Index | Old Index