diff options
author | Otto Moerbeek <otto@cvs.openbsd.org> | 2018-11-06 07:49:39 +0000 |
---|---|---|
committer | Otto Moerbeek <otto@cvs.openbsd.org> | 2018-11-06 07:49:39 +0000 |
commit | b720da78f4ed4158e7ce561391c88207e62b86b0 (patch) | |
tree | d95b74a50d7de6da66ecc498982535eae8367ef8 /sys/uvm | |
parent | e753e63d06fa222b6b735c99660e9a440cd2522c (diff) |
new sysctl for userland malloc flags, kernel part. ok millert@ deraadt@
Diffstat (limited to 'sys/uvm')
-rw-r--r-- | sys/uvm/uvm_meter.c | 7 | ||||
-rw-r--r-- | sys/uvm/uvmexp.h | 6 |
2 files changed, 10 insertions, 3 deletions
diff --git a/sys/uvm/uvm_meter.c b/sys/uvm/uvm_meter.c index e66267b12b7..794811366ba 100644 --- a/sys/uvm/uvm_meter.c +++ b/sys/uvm/uvm_meter.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_meter.c,v 1.37 2017/05/09 09:36:04 mpi Exp $ */ +/* $OpenBSD: uvm_meter.c,v 1.38 2018/11/06 07:49:38 otto Exp $ */ /* $NetBSD: uvm_meter.c,v 1.21 2001/07/14 06:36:03 matt Exp $ */ /* @@ -139,6 +139,8 @@ uvm_loadav(struct loadavg *avg) } } +char malloc_conf[16]; + /* * uvm_sysctl: sysctl hook into UVM system. */ @@ -231,6 +233,9 @@ uvm_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, void *newp, case VM_USPACE: return (sysctl_rdint(oldp, oldlenp, newp, USPACE)); + case VM_MALLOC_CONF: + return (sysctl_string(oldp, oldlenp, newp, newlen, + malloc_conf, sizeof(malloc_conf))); default: return (EOPNOTSUPP); } diff --git a/sys/uvm/uvmexp.h b/sys/uvm/uvmexp.h index fb54027432e..b2a98379a64 100644 --- a/sys/uvm/uvmexp.h +++ b/sys/uvm/uvmexp.h @@ -1,4 +1,4 @@ -/* $OpenBSD: uvmexp.h,v 1.3 2018/06/19 22:35:07 krw Exp $ */ +/* $OpenBSD: uvmexp.h,v 1.4 2018/11/06 07:49:38 otto Exp $ */ #ifndef _UVM_UVMEXP_ #define _UVM_UVMEXP_ @@ -17,7 +17,8 @@ #define VM_VNODEMIN 9 #define VM_MAXSLP 10 #define VM_USPACE 11 -#define VM_MAXID 12 /* number of valid vm ids */ +#define VM_MALLOC_CONF 12 /* config for userland malloc */ +#define VM_MAXID 13 /* number of valid vm ids */ #define CTL_VM_NAMES { \ { 0, 0 }, \ @@ -32,6 +33,7 @@ { "vnodemin", CTLTYPE_INT }, \ { "maxslp", CTLTYPE_INT }, \ { "uspace", CTLTYPE_INT }, \ + { "malloc_conf", CTLTYPE_STRING }, \ } /* |