diff options
author | Artur Grabowski <art@cvs.openbsd.org> | 2001-12-06 12:43:21 +0000 |
---|---|---|
committer | Artur Grabowski <art@cvs.openbsd.org> | 2001-12-06 12:43:21 +0000 |
commit | eebe1c8766771b51396f0c4de8f48b058653d374 (patch) | |
tree | 995507ce72473653abb79d66933ee5de9bac7446 /sys/uvm/uvm_page.c | |
parent | bc76544e734973512f81c56a6cc5c67700a21552 (diff) |
Keep track of how many pages a vnode hold with vhold and vholdrele
so that we can get back the old behavior where a vnode with cached data
is less likely to be recycled than a vnode without cached data.
XXX - This is a brute-force solution - we do it where uvmexp.vnodepages
are changed, I am not really sure it is correct but people have been
very happy with the diff so far and want this in the tree.
Diffstat (limited to 'sys/uvm/uvm_page.c')
-rw-r--r-- | sys/uvm/uvm_page.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/sys/uvm/uvm_page.c b/sys/uvm/uvm_page.c index 0da38fc51ed..ed2a8c6f601 100644 --- a/sys/uvm/uvm_page.c +++ b/sys/uvm/uvm_page.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_page.c,v 1.37 2001/12/04 23:22:42 art Exp $ */ +/* $OpenBSD: uvm_page.c,v 1.38 2001/12/06 12:43:20 art Exp $ */ /* $NetBSD: uvm_page.c,v 1.66 2001/09/10 21:19:43 chris Exp $ */ /* @@ -197,10 +197,14 @@ uvm_pageremove(pg) simple_unlock(&uvm.hashlock); splx(s); - if (UVM_OBJ_IS_VTEXT(pg->uobject)) { - uvmexp.vtextpages--; - } else if (UVM_OBJ_IS_VNODE(pg->uobject)) { - uvmexp.vnodepages--; + if (UVM_OBJ_IS_VTEXT(pg->uobject) || UVM_OBJ_IS_VNODE(pg->uobject)) { + if (UVM_OBJ_IS_VNODE(pg->uobject)) + uvmexp.vnodepages--; + else + uvmexp.vtextpages--; + s = splbio(); + vholdrele((struct vnode *)pg->uobject); + splx(s); } /* object should be locked */ |