diff options
author | Artur Grabowski <art@cvs.openbsd.org> | 2001-11-12 01:26:11 +0000 |
---|---|---|
committer | Artur Grabowski <art@cvs.openbsd.org> | 2001-11-12 01:26:11 +0000 |
commit | 6f622671e86434b2fa80299a0e9545fb83b45ca7 (patch) | |
tree | e7659c198c13ca9b253eef13911915a894742434 /sys/uvm/uvm_meter.c | |
parent | 1cf132e0e8e9b2b0914a758674d9861559da7781 (diff) |
Bring in more changes from NetBSD. Mostly pagedaemon improvements.
Diffstat (limited to 'sys/uvm/uvm_meter.c')
-rw-r--r-- | sys/uvm/uvm_meter.c | 43 |
1 files changed, 41 insertions, 2 deletions
diff --git a/sys/uvm/uvm_meter.c b/sys/uvm/uvm_meter.c index e98bae74f60..04bb3b3a2e0 100644 --- a/sys/uvm/uvm_meter.c +++ b/sys/uvm/uvm_meter.c @@ -1,5 +1,5 @@ -/* $OpenBSD: uvm_meter.c,v 1.14 2001/11/07 02:55:50 art Exp $ */ -/* $NetBSD: uvm_meter.c,v 1.14 2000/11/24 18:54:31 chs Exp $ */ +/* $OpenBSD: uvm_meter.c,v 1.15 2001/11/12 01:26:09 art Exp $ */ +/* $NetBSD: uvm_meter.c,v 1.17 2001/03/09 01:02:12 chs Exp $ */ /* * Copyright (c) 1997 Charles D. Cranor and Washington University. @@ -132,6 +132,7 @@ uvm_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p) struct proc *p; { struct vmtotal vmtotals; + int rv, t; struct _ps_strings _ps = { PS_STRINGS }; switch (name[0]) { @@ -169,6 +170,44 @@ uvm_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p) case VM_PSSTRINGS: return (sysctl_rdstruct(oldp, oldlenp, newp, &_ps, sizeof(_ps))); + case VM_ANONMIN: + t = uvmexp.anonminpct; + rv = sysctl_int(oldp, oldlenp, newp, newlen, &t); + if (rv) { + return rv; + } + if (t + uvmexp.vtextminpct + uvmexp.vnodeminpct > 95 || t < 0) { + return EINVAL; + } + uvmexp.anonminpct = t; + uvmexp.anonmin = t * 256 / 100; + return rv; + + case VM_VTEXTMIN: + t = uvmexp.vtextminpct; + rv = sysctl_int(oldp, oldlenp, newp, newlen, &t); + if (rv) { + return rv; + } + if (uvmexp.anonminpct + t + uvmexp.vnodeminpct > 95 || t < 0) { + return EINVAL; + } + uvmexp.vtextminpct = t; + uvmexp.vtextmin = t * 256 / 100; + return rv; + + case VM_VNODEMIN: + t = uvmexp.vnodeminpct; + rv = sysctl_int(oldp, oldlenp, newp, newlen, &t); + if (rv) { + return rv; + } + if (uvmexp.anonminpct + uvmexp.vtextminpct + t > 95 || t < 0) { + return EINVAL; + } + uvmexp.vnodeminpct = t; + uvmexp.vnodemin = t * 256 / 100; + return rv; default: return (EOPNOTSUPP); } |