count aobj pages (most notably kernel stack pages) as anon pages

for memory usage-balancing purposes.
This commit is contained in:
chs 2002-06-20 15:05:29 +00:00
parent 3a63625506
commit faab7dbb46
3 changed files with 14 additions and 6 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: uvm_object.h,v 1.15 2002/05/15 06:57:50 matt Exp $ */
/* $NetBSD: uvm_object.h,v 1.16 2002/06/20 15:05:29 chs Exp $ */
/*
*
@ -84,6 +84,8 @@ extern struct uvm_pagerops aobj_pager;
((uobj)->pgops == &uvm_vnodeops && \
((struct vnode *)uobj)->v_flag & VEXECMAP)
#define UVM_OBJ_IS_AOBJ(uobj) \
((uobj)->pgops == &aobj_pager)
#endif /* _KERNEL */

View File

@ -1,4 +1,4 @@
/* $NetBSD: uvm_page.c,v 1.77 2002/06/19 17:01:18 wrstuden Exp $ */
/* $NetBSD: uvm_page.c,v 1.78 2002/06/20 15:05:29 chs 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.77 2002/06/19 17:01:18 wrstuden Exp $");
__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.78 2002/06/20 15:05:29 chs Exp $");
#include "opt_uvmhist.h"
@ -172,6 +172,10 @@ uvm_pageinsert(pg)
TAILQ_INSERT_TAIL(buck, pg, hashq);
simple_unlock(&uvm.hashlock);
if (UVM_OBJ_IS_AOBJ(uobj)) {
uvmexp.anonpages++;
}
TAILQ_INSERT_TAIL(&uobj->memq, pg, listq);
pg->flags |= PG_TABLED;
uobj->uo_npages++;
@ -201,6 +205,8 @@ uvm_pageremove(pg)
uvmexp.execpages--;
} else if (UVM_OBJ_IS_VNODE(uobj)) {
uvmexp.filepages--;
} else if (UVM_OBJ_IS_AOBJ(uobj)) {
uvmexp.anonpages--;
}
/* object should be locked */

View File

@ -1,4 +1,4 @@
/* $NetBSD: uvm_pdaemon.c,v 1.46 2002/05/05 16:26:17 chs Exp $ */
/* $NetBSD: uvm_pdaemon.c,v 1.47 2002/06/20 15:05:29 chs Exp $ */
/*
* Copyright (c) 1997 Charles D. Cranor and Washington University.
@ -71,7 +71,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: uvm_pdaemon.c,v 1.46 2002/05/05 16:26:17 chs Exp $");
__KERNEL_RCSID(0, "$NetBSD: uvm_pdaemon.c,v 1.47 2002/06/20 15:05:29 chs Exp $");
#include "opt_uvmhist.h"
@ -463,7 +463,7 @@ uvmpd_scan_inactive(pglst)
uvmexp.pdrefile++;
continue;
}
if (anon && anonreact) {
if ((anon || UVM_OBJ_IS_AOBJ(uobj)) && anonreact) {
uvm_pageactivate(p);
uvmexp.pdreanon++;
continue;