Source-Changes-HG archive

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

[src/trunk]: src/sys/uvm uvm_pagefree: when orphaning an A->K loaned page,



details:   https://anonhg.NetBSD.org/src/rev/1e548c95c52d
branches:  trunk
changeset: 569719:1e548c95c52d
user:      yamt <yamt%NetBSD.org@localhost>
date:      Wed Sep 01 11:53:38 2004 +0000

description:
uvm_pagefree: when orphaning an A->K loaned page,
        - decrement uvmexp.anonpages as it's no longer an anon page.
        - null out anon->u.an_page as the anon no longer own the page.
uvm_anfree: add related assertions.

diffstat:

 sys/uvm/uvm_anon.c |  7 +++++--
 sys/uvm/uvm_page.c |  6 ++++--
 2 files changed, 9 insertions(+), 4 deletions(-)

diffs (56 lines):

diff -r b917e4ce126b -r 1e548c95c52d sys/uvm/uvm_anon.c
--- a/sys/uvm/uvm_anon.c        Wed Sep 01 10:09:26 2004 +0000
+++ b/sys/uvm/uvm_anon.c        Wed Sep 01 11:53:38 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uvm_anon.c,v 1.30 2004/09/01 10:09:26 yamt Exp $       */
+/*     $NetBSD: uvm_anon.c,v 1.31 2004/09/01 11:53:38 yamt Exp $       */
 
 /*
  *
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_anon.c,v 1.30 2004/09/01 10:09:26 yamt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_anon.c,v 1.31 2004/09/01 11:53:38 yamt Exp $");
 
 #include "opt_uvmhist.h"
 
@@ -279,6 +279,9 @@
         * free the anon itself.
         */
 
+       KASSERT(anon->u.an_page == NULL);
+       KASSERT(anon->an_swslot == 0);
+
        simple_lock(&uvm.afreelock);
        anon->u.an_nxt = uvm.afree;
        uvm.afree = anon;
diff -r b917e4ce126b -r 1e548c95c52d sys/uvm/uvm_page.c
--- a/sys/uvm/uvm_page.c        Wed Sep 01 10:09:26 2004 +0000
+++ b/sys/uvm/uvm_page.c        Wed Sep 01 11:53:38 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uvm_page.c,v 1.98 2004/05/05 11:58:27 yamt Exp $       */
+/*     $NetBSD: uvm_page.c,v 1.99 2004/09/01 11:53:38 yamt Exp $       */
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -71,7 +71,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.98 2004/05/05 11:58:27 yamt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.99 2004/09/01 11:53:38 yamt Exp $");
 
 #include "opt_uvmhist.h"
 
@@ -1360,7 +1360,9 @@
                                pg->loan_count--;
                        } else {
                                pg->pqflags &= ~PQ_ANON;
+                               uvmexp.anonpages--;
                        }
+                       pg->uanon->u.an_page = NULL;
                        pg->uanon = NULL;
                }
                if (pg->flags & PG_WANTED) {



Home | Main Index | Thread Index | Old Index