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.
This commit is contained in:
parent
4b8a7a0e49
commit
33999a4224
|
@ -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 @@ struct uvmexp {
|
||||||
/* XXX: Adding anything before this line will break binary
|
/* XXX: Adding anything before this line will break binary
|
||||||
* compatibility with top(1) on NetBSD 1.5.
|
* 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_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 */
|
/* pageout params */
|
||||||
int freemin; /* min number of free pages */
|
int freemin; /* min number of free pages */
|
||||||
|
@ -267,7 +270,6 @@ struct uvmexp {
|
||||||
/* swap */
|
/* swap */
|
||||||
int nswapdev; /* number of configured swap devices in system */
|
int nswapdev; /* number of configured swap devices in system */
|
||||||
int swpages; /* number of PAGE_SIZE'ed swap pages */
|
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 swpginuse; /* number of swap pages in use */
|
||||||
int swpgonly; /* number of swap pages in use, not also in RAM */
|
int swpgonly; /* number of swap pages in use, not also in RAM */
|
||||||
int nswget; /* number of times fault calls uvm_swap_get() */
|
int nswget; /* number of times fault calls uvm_swap_get() */
|
||||||
|
@ -361,7 +363,6 @@ struct uvmexp_sysctl {
|
||||||
int64_t wiredmax;
|
int64_t wiredmax;
|
||||||
int64_t nswapdev;
|
int64_t nswapdev;
|
||||||
int64_t swpages;
|
int64_t swpages;
|
||||||
int64_t swpguniq;
|
|
||||||
int64_t swpginuse;
|
int64_t swpginuse;
|
||||||
int64_t swpgonly;
|
int64_t swpgonly;
|
||||||
int64_t nswget;
|
int64_t nswget;
|
||||||
|
@ -415,6 +416,9 @@ struct uvmexp_sysctl {
|
||||||
int64_t pdpageouts;
|
int64_t pdpageouts;
|
||||||
int64_t pdpending;
|
int64_t pdpending;
|
||||||
int64_t pddeact;
|
int64_t pddeact;
|
||||||
|
int64_t anonpages;
|
||||||
|
int64_t vnodepages;
|
||||||
|
int64_t vtextpages;
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef _KERNEL
|
#ifdef _KERNEL
|
||||||
|
|
|
@ -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.
|
* Copyright (c) 1997 Charles D. Cranor and Washington University.
|
||||||
|
@ -169,6 +169,9 @@ sysctl_uvmexp(oldp, oldlenp)
|
||||||
{
|
{
|
||||||
struct uvmexp_sysctl u;
|
struct uvmexp_sysctl u;
|
||||||
|
|
||||||
|
memset(&u, 0, sizeof(u));
|
||||||
|
|
||||||
|
/* Entries here are in order of uvmexp_sysctl, not uvmexp */
|
||||||
u.pagesize = uvmexp.pagesize;
|
u.pagesize = uvmexp.pagesize;
|
||||||
u.pagemask = uvmexp.pagemask;
|
u.pagemask = uvmexp.pagemask;
|
||||||
u.pageshift = uvmexp.pageshift;
|
u.pageshift = uvmexp.pageshift;
|
||||||
|
@ -187,7 +190,6 @@ sysctl_uvmexp(oldp, oldlenp)
|
||||||
u.wiredmax = uvmexp.wiredmax;
|
u.wiredmax = uvmexp.wiredmax;
|
||||||
u.nswapdev = uvmexp.nswapdev;
|
u.nswapdev = uvmexp.nswapdev;
|
||||||
u.swpages = uvmexp.swpages;
|
u.swpages = uvmexp.swpages;
|
||||||
u.swpguniq = uvmexp.swpguniq;
|
|
||||||
u.swpginuse = uvmexp.swpginuse;
|
u.swpginuse = uvmexp.swpginuse;
|
||||||
u.swpgonly = uvmexp.swpgonly;
|
u.swpgonly = uvmexp.swpgonly;
|
||||||
u.nswget = uvmexp.nswget;
|
u.nswget = uvmexp.nswget;
|
||||||
|
@ -241,6 +243,9 @@ sysctl_uvmexp(oldp, oldlenp)
|
||||||
u.pdpageouts = uvmexp.pdpageouts;
|
u.pdpageouts = uvmexp.pdpageouts;
|
||||||
u.pdpending = uvmexp.pdpending;
|
u.pdpending = uvmexp.pdpending;
|
||||||
u.pddeact = uvmexp.pddeact;
|
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)));
|
return (sysctl_rdminstruct(oldp, oldlenp, NULL, &u, sizeof(u)));
|
||||||
}
|
}
|
||||||
|
|
|
@ -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.
|
* Copyright (c) 1997 Charles D. Cranor and Washington University.
|
||||||
|
@ -103,8 +103,6 @@ int vm_nphysseg = 0; /* XXXCDC: uvm.nphysseg */
|
||||||
*/
|
*/
|
||||||
boolean_t vm_page_zero_enable = FALSE;
|
boolean_t vm_page_zero_enable = FALSE;
|
||||||
|
|
||||||
u_long uvm_pgcnt_anon;
|
|
||||||
u_long uvm_pgcnt_vnode;
|
|
||||||
extern struct uvm_pagerops uvm_vnodeops;
|
extern struct uvm_pagerops uvm_vnodeops;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -195,7 +193,7 @@ uvm_pageremove(pg)
|
||||||
splx(s);
|
splx(s);
|
||||||
|
|
||||||
if (pg->uobject->pgops == &uvm_vnodeops) {
|
if (pg->uobject->pgops == &uvm_vnodeops) {
|
||||||
uvm_pgcnt_vnode--;
|
uvmexp.vnodepages--;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* object should be locked */
|
/* object should be locked */
|
||||||
|
@ -1009,7 +1007,7 @@ uvm_pagealloc_strat(obj, off, anon, flags, strat, free_list)
|
||||||
if (anon) {
|
if (anon) {
|
||||||
anon->u.an_page = pg;
|
anon->u.an_page = pg;
|
||||||
pg->pqflags = PQ_ANON;
|
pg->pqflags = PQ_ANON;
|
||||||
uvm_pgcnt_anon++;
|
uvmexp.anonpages++;
|
||||||
} else {
|
} else {
|
||||||
if (obj)
|
if (obj)
|
||||||
uvm_pageinsert(pg);
|
uvm_pageinsert(pg);
|
||||||
|
@ -1167,7 +1165,7 @@ uvm_pagefree(pg)
|
||||||
uvmexp.wired--;
|
uvmexp.wired--;
|
||||||
}
|
}
|
||||||
if (pg->uanon) {
|
if (pg->uanon) {
|
||||||
uvm_pgcnt_anon--;
|
uvmexp.anonpages--;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -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.
|
* Copyright (c) 1997 Charles D. Cranor and Washington University.
|
||||||
|
@ -81,7 +81,6 @@
|
||||||
|
|
||||||
#include <uvm/uvm.h>
|
#include <uvm/uvm.h>
|
||||||
|
|
||||||
extern u_long uvm_pgcnt_vnode;
|
|
||||||
extern struct uvm_pagerops uvm_vnodeops;
|
extern struct uvm_pagerops uvm_vnodeops;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -254,7 +253,7 @@ uvm_pageout(void *arg)
|
||||||
|
|
||||||
if (uvmexp.free + uvmexp.paging < uvmexp.freetarg ||
|
if (uvmexp.free + uvmexp.paging < uvmexp.freetarg ||
|
||||||
uvmexp.inactive < uvmexp.inactarg ||
|
uvmexp.inactive < uvmexp.inactarg ||
|
||||||
uvm_pgcnt_vnode >
|
uvmexp.vnodepages >
|
||||||
(uvmexp.active + uvmexp.inactive + uvmexp.wired +
|
(uvmexp.active + uvmexp.inactive + uvmexp.wired +
|
||||||
uvmexp.free) * 13 / 16) {
|
uvmexp.free) * 13 / 16) {
|
||||||
uvmpd_scan();
|
uvmpd_scan();
|
||||||
|
@ -421,7 +420,7 @@ uvmpd_scan_inactive(pglst)
|
||||||
uvm_unlock_fpageq(s);
|
uvm_unlock_fpageq(s);
|
||||||
|
|
||||||
/* XXXUBC */
|
/* XXXUBC */
|
||||||
vpgs = uvm_pgcnt_vnode -
|
vpgs = uvmexp.vnodepages -
|
||||||
(uvmexp.active + uvmexp.inactive +
|
(uvmexp.active + uvmexp.inactive +
|
||||||
uvmexp.wired + uvmexp.free) * 13 / 16;
|
uvmexp.wired + uvmexp.free) * 13 / 16;
|
||||||
|
|
||||||
|
|
|
@ -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.
|
* Copyright (c) 1997 Charles D. Cranor and Washington University.
|
||||||
|
@ -71,8 +71,6 @@
|
||||||
#include <uvm/uvm.h>
|
#include <uvm/uvm.h>
|
||||||
#include <uvm/uvm_vnode.h>
|
#include <uvm/uvm_vnode.h>
|
||||||
|
|
||||||
extern u_long uvm_pgcnt_vnode;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* functions
|
* functions
|
||||||
*/
|
*/
|
||||||
|
@ -943,13 +941,13 @@ uvn_findpage(uobj, offset, pgp, flags)
|
||||||
UVMHIST_LOG(ubchist, "noalloc", 0,0,0,0);
|
UVMHIST_LOG(ubchist, "noalloc", 0,0,0,0);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (uvm_pgcnt_vnode >
|
if (uvmexp.vnodepages >
|
||||||
(uvmexp.active + uvmexp.inactive + uvmexp.wired +
|
(uvmexp.active + uvmexp.inactive + uvmexp.wired +
|
||||||
uvmexp.free) * 7 / 8) {
|
uvmexp.free) * 7 / 8) {
|
||||||
pg = NULL;
|
pg = NULL;
|
||||||
} else {
|
} else {
|
||||||
pg = uvm_pagealloc(uobj, offset, NULL, 0);
|
pg = uvm_pagealloc(uobj, offset, NULL, 0);
|
||||||
uvm_pgcnt_vnode++;
|
uvmexp.vnodepages++;
|
||||||
}
|
}
|
||||||
if (pg == NULL) {
|
if (pg == NULL) {
|
||||||
if (flags & UFP_NOWAIT) {
|
if (flags & UFP_NOWAIT) {
|
||||||
|
|
Loading…
Reference in New Issue