diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2007-12-15 03:42:58 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2007-12-15 03:42:58 +0000 |
commit | d196417615cee2b0bef878d8bece937836f17b1f (patch) | |
tree | 2130f8edd515794a485bb5c3c9f5b54a3ca7f11a /sys | |
parent | 30fb6d4ee3269e33a51b16f67d27c473cd3a5e3a (diff) |
export kernel uvm_km_pages_free as vm.kmpagesfree; ok tedu, tested jsg
Diffstat (limited to 'sys')
-rw-r--r-- | sys/uvm/uvm_km.c | 5 | ||||
-rw-r--r-- | sys/uvm/uvm_meter.c | 6 | ||||
-rw-r--r-- | sys/uvm/uvm_param.h | 6 |
3 files changed, 12 insertions, 5 deletions
diff --git a/sys/uvm/uvm_km.c b/sys/uvm/uvm_km.c index 9f01d2ac560..002455a97df 100644 --- a/sys/uvm/uvm_km.c +++ b/sys/uvm/uvm_km.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_km.c,v 1.65 2007/12/11 15:05:45 tedu Exp $ */ +/* $OpenBSD: uvm_km.c,v 1.66 2007/12/15 03:42:57 deraadt Exp $ */ /* $NetBSD: uvm_km.c,v 1.42 2001/01/14 02:10:01 thorpej Exp $ */ /* @@ -744,6 +744,8 @@ uvm_km_free_poolpage1(struct vm_map *map, vaddr_t addr) #endif /* __HAVE_PMAP_DIRECT */ } +int uvm_km_pages_free; /* number of pages currently on free list */ + #if defined(__HAVE_PMAP_DIRECT) /* * uvm_km_page allocator, __HAVE_PMAP_DIRECT arch @@ -785,7 +787,6 @@ uvm_km_putpage(void *v) struct mutex uvm_km_mtx; int uvm_km_pages_lowat; /* allocate more when reserve drops below this */ -int uvm_km_pages_free; /* number of pages currently on free list */ struct km_page { struct km_page *next; } *uvm_km_pages_head; diff --git a/sys/uvm/uvm_meter.c b/sys/uvm/uvm_meter.c index 007921d85a2..80291539872 100644 --- a/sys/uvm/uvm_meter.c +++ b/sys/uvm/uvm_meter.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_meter.c,v 1.23 2007/10/10 15:53:53 art Exp $ */ +/* $OpenBSD: uvm_meter.c,v 1.24 2007/12/15 03:42:57 deraadt Exp $ */ /* $NetBSD: uvm_meter.c,v 1.21 2001/07/14 06:36:03 matt Exp $ */ /* @@ -137,6 +137,7 @@ uvm_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p) struct vmtotal vmtotals; int rv, t; struct _ps_strings _ps = { PS_STRINGS }; + extern int uvm_km_pages_free; switch (name[0]) { case VM_SWAPENCRYPT: @@ -218,6 +219,9 @@ uvm_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p) case VM_USPACE: return (sysctl_rdint(oldp, oldlenp, newp, USPACE)); + case VM_KMPAGESFREE: + return (sysctl_rdint(oldp, oldlenp, newp, uvm_km_pages_free)); + default: return (EOPNOTSUPP); } diff --git a/sys/uvm/uvm_param.h b/sys/uvm/uvm_param.h index 788539aea56..91e41bf2013 100644 --- a/sys/uvm/uvm_param.h +++ b/sys/uvm/uvm_param.h @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_param.h,v 1.12 2007/03/26 08:43:34 art Exp $ */ +/* $OpenBSD: uvm_param.h,v 1.13 2007/12/15 03:42:57 deraadt Exp $ */ /* $NetBSD: uvm_param.h,v 1.5 2001/03/09 01:02:12 chs Exp $ */ /* @@ -112,7 +112,8 @@ typedef int boolean_t; #define VM_VNODEMIN 9 #define VM_MAXSLP 10 #define VM_USPACE 11 -#define VM_MAXID 12 /* number of valid vm ids */ +#define VM_KMPAGESFREE 12 +#define VM_MAXID 13 /* number of valid vm ids */ #define CTL_VM_NAMES { \ { 0, 0 }, \ @@ -127,6 +128,7 @@ typedef int boolean_t; { "vnodemin", CTLTYPE_INT }, \ { "maxslp", CTLTYPE_INT }, \ { "uspace", CTLTYPE_INT }, \ + { "kmpagesfree", CTLTYPE_INT }, \ } struct _ps_strings { |