Source-Changes-HG archive

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

[src/trunk]: src/sys/uvm Move uvm_pgcnt_vnode and uvm_pgcnt_anon into uvmexp ...



details:   https://anonhg.NetBSD.org/src/rev/ac727f2a98cb
branches:  trunk
changeset: 499820:ac727f2a98cb
user:      simonb <simonb%NetBSD.org@localhost>
date:      Thu Nov 30 11:04:43 2000 +0000

description:
Move uvm_pgcnt_vnode and uvm_pgcnt_anon into uvmexp (as vnodepages and
anonpages), and add vtextpages which is currently unused but will be
used to trace the number of pages used by vtext vnodes.

diffstat:

 sys/uvm/uvm_extern.h  |  16 ++++++++++------
 sys/uvm/uvm_meter.c   |   9 +++++++--
 sys/uvm/uvm_page.c    |  10 ++++------
 sys/uvm/uvm_pdaemon.c |   7 +++----
 sys/uvm/uvm_vnode.c   |   8 +++-----
 5 files changed, 27 insertions(+), 23 deletions(-)

diffs (210 lines):

diff -r 4d9f7a3101b2 -r ac727f2a98cb sys/uvm/uvm_extern.h
--- a/sys/uvm/uvm_extern.h      Thu Nov 30 10:09:15 2000 +0000
+++ b/sys/uvm/uvm_extern.h      Thu Nov 30 11:04:43 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uvm_extern.h,v 1.54 2000/11/29 09:52:18 simonb Exp $   */
+/*     $NetBSD: uvm_extern.h,v 1.55 2000/11/30 11:04:43 simonb Exp $   */
 
 /*
  *
@@ -254,9 +254,12 @@
        /* XXX: Adding anything before this line will break binary
         *      compatibility with top(1) on NetBSD 1.5.
         */
-       int zeropages;  /* number of zero'd pages */
+       int zeropages;          /* number of zero'd pages */
        int reserve_pagedaemon; /* number of pages reserved for pagedaemon */
-       int reserve_kernel; /* number of pages reserved for kernel */
+       int reserve_kernel;     /* number of pages reserved for kernel */
+       int anonpages;          /* number of pages used by anon pagers */
+       int vnodepages;         /* number of pages used by vnode page cache */
+       int vtextpages;         /* number of pages used by vtext vnodes */
 
        /* pageout params */
        int freemin;    /* min number of free pages */
@@ -267,7 +270,6 @@
        /* swap */
        int nswapdev;   /* number of configured swap devices in system */
        int swpages;    /* number of PAGE_SIZE'ed swap pages */
-       int swpguniq;   /* number of swap pages in use, not also in RAM */
        int swpginuse;  /* number of swap pages in use */
        int swpgonly;   /* number of swap pages in use, not also in RAM */
        int nswget;     /* number of times fault calls uvm_swap_get() */
@@ -331,7 +333,7 @@
        int pdpageouts; /* number of times daemon started a pageout */
        int pdpending;  /* number of times daemon got a pending pagout */
        int pddeact;    /* number of pages daemon deactivates */
-       
+
        /* kernel memory objects: managed by uvm_km_kmemalloc() only! */
        struct uvm_object *kmem_object;
        struct uvm_object *mb_object;
@@ -361,7 +363,6 @@
        int64_t wiredmax;
        int64_t nswapdev;
        int64_t swpages;
-       int64_t swpguniq;
        int64_t swpginuse;
        int64_t swpgonly;
        int64_t nswget;
@@ -415,6 +416,9 @@
        int64_t pdpageouts;
        int64_t pdpending;
        int64_t pddeact;
+       int64_t anonpages;
+       int64_t vnodepages;
+       int64_t vtextpages;
 };
 
 #ifdef _KERNEL
diff -r 4d9f7a3101b2 -r ac727f2a98cb sys/uvm/uvm_meter.c
--- a/sys/uvm/uvm_meter.c       Thu Nov 30 10:09:15 2000 +0000
+++ b/sys/uvm/uvm_meter.c       Thu Nov 30 11:04:43 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uvm_meter.c,v 1.15 2000/11/29 09:52:19 simonb Exp $    */
+/*     $NetBSD: uvm_meter.c,v 1.16 2000/11/30 11:04:44 simonb Exp $    */
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -169,6 +169,9 @@
 {
        struct uvmexp_sysctl u;
 
+       memset(&u, 0, sizeof(u));
+
+       /* Entries here are in order of uvmexp_sysctl, not uvmexp */
        u.pagesize = uvmexp.pagesize;
        u.pagemask = uvmexp.pagemask;
        u.pageshift = uvmexp.pageshift;
@@ -187,7 +190,6 @@
        u.wiredmax = uvmexp.wiredmax;
        u.nswapdev = uvmexp.nswapdev;
        u.swpages = uvmexp.swpages;
-       u.swpguniq = uvmexp.swpguniq;
        u.swpginuse = uvmexp.swpginuse;
        u.swpgonly = uvmexp.swpgonly;
        u.nswget = uvmexp.nswget;
@@ -241,6 +243,9 @@
        u.pdpageouts = uvmexp.pdpageouts;
        u.pdpending = uvmexp.pdpending;
        u.pddeact = uvmexp.pddeact;
+       u.anonpages = uvmexp.anonpages;
+       u.vnodepages = uvmexp.vnodepages;
+       u.vtextpages = uvmexp.vtextpages;
 
        return (sysctl_rdminstruct(oldp, oldlenp, NULL, &u, sizeof(u)));
 }
diff -r 4d9f7a3101b2 -r ac727f2a98cb sys/uvm/uvm_page.c
--- a/sys/uvm/uvm_page.c        Thu Nov 30 10:09:15 2000 +0000
+++ b/sys/uvm/uvm_page.c        Thu Nov 30 11:04:43 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uvm_page.c,v 1.44 2000/11/27 08:40:04 chs Exp $        */
+/*     $NetBSD: uvm_page.c,v 1.45 2000/11/30 11:04:44 simonb Exp $     */
 
 /* 
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -103,8 +103,6 @@
  */
 boolean_t vm_page_zero_enable = FALSE;
 
-u_long uvm_pgcnt_anon;
-u_long uvm_pgcnt_vnode;
 extern struct uvm_pagerops uvm_vnodeops;
 
 /*
@@ -195,7 +193,7 @@
        splx(s);
 
        if (pg->uobject->pgops == &uvm_vnodeops) {
-               uvm_pgcnt_vnode--;
+               uvmexp.vnodepages--;
        }
 
        /* object should be locked */
@@ -1009,7 +1007,7 @@
        if (anon) {
                anon->u.an_page = pg;
                pg->pqflags = PQ_ANON;
-               uvm_pgcnt_anon++;
+               uvmexp.anonpages++;
        } else {
                if (obj)
                        uvm_pageinsert(pg);
@@ -1167,7 +1165,7 @@
                uvmexp.wired--;
        }
        if (pg->uanon) {
-               uvm_pgcnt_anon--;
+               uvmexp.anonpages--;
        }
 
        /*
diff -r 4d9f7a3101b2 -r ac727f2a98cb sys/uvm/uvm_pdaemon.c
--- a/sys/uvm/uvm_pdaemon.c     Thu Nov 30 10:09:15 2000 +0000
+++ b/sys/uvm/uvm_pdaemon.c     Thu Nov 30 11:04:43 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uvm_pdaemon.c,v 1.24 2000/11/27 08:40:05 chs Exp $     */
+/*     $NetBSD: uvm_pdaemon.c,v 1.25 2000/11/30 11:04:44 simonb Exp $  */
 
 /* 
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -81,7 +81,6 @@
 
 #include <uvm/uvm.h>
 
-extern u_long uvm_pgcnt_vnode;
 extern struct uvm_pagerops uvm_vnodeops;
 
 /*
@@ -254,7 +253,7 @@
 
                if (uvmexp.free + uvmexp.paging < uvmexp.freetarg ||
                    uvmexp.inactive < uvmexp.inactarg ||
-                   uvm_pgcnt_vnode >
+                   uvmexp.vnodepages >
                    (uvmexp.active + uvmexp.inactive + uvmexp.wired +
                     uvmexp.free) * 13 / 16) {
                        uvmpd_scan();
@@ -421,7 +420,7 @@
                        uvm_unlock_fpageq(s);
 
                        /* XXXUBC */
-                       vpgs = uvm_pgcnt_vnode -
+                       vpgs = uvmexp.vnodepages -
                                (uvmexp.active + uvmexp.inactive +
                                 uvmexp.wired + uvmexp.free) * 13 / 16;
 
diff -r 4d9f7a3101b2 -r ac727f2a98cb sys/uvm/uvm_vnode.c
--- a/sys/uvm/uvm_vnode.c       Thu Nov 30 10:09:15 2000 +0000
+++ b/sys/uvm/uvm_vnode.c       Thu Nov 30 11:04:43 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uvm_vnode.c,v 1.37 2000/11/27 08:40:06 chs Exp $       */
+/*     $NetBSD: uvm_vnode.c,v 1.38 2000/11/30 11:04:44 simonb Exp $    */
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -71,8 +71,6 @@
 #include <uvm/uvm.h>
 #include <uvm/uvm_vnode.h>
 
-extern u_long uvm_pgcnt_vnode;
-
 /*
  * functions
  */
@@ -943,13 +941,13 @@
                                UVMHIST_LOG(ubchist, "noalloc", 0,0,0,0);
                                return 0;
                        }
-                       if (uvm_pgcnt_vnode > 
+                       if (uvmexp.vnodepages > 
                            (uvmexp.active + uvmexp.inactive + uvmexp.wired +
                             uvmexp.free) * 7 / 8) {
                                pg = NULL;
                        } else {
                                pg = uvm_pagealloc(uobj, offset, NULL, 0);
-                               uvm_pgcnt_vnode++;
+                               uvmexp.vnodepages++;
                        }
                        if (pg == NULL) {
                                if (flags & UFP_NOWAIT) {



Home | Main Index | Thread Index | Old Index