aboutsummaryrefslogtreecommitdiff
path: root/sys/vm/vm_kern.c
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2021-04-04 16:28:14 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2021-04-04 17:39:06 +0000
commit89619b747bcff379dca98e975a98865a45366417 (patch)
treed96ed94b0d280799cd1d187ee84e84fc75aaf7b4 /sys/vm/vm_kern.c
parent51a7be5f6036ebd47c8b3f704d52e7ec3f837114 (diff)
downloadsrc-89619b747bcff379dca98e975a98865a45366417.tar.gz
src-89619b747bcff379dca98e975a98865a45366417.zip
Add sysctl debug.uma_reclaim
Sponsored by: The FreeBSD Foundation MFC after: 1 week
Diffstat (limited to 'sys/vm/vm_kern.c')
-rw-r--r--sys/vm/vm_kern.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/sys/vm/vm_kern.c b/sys/vm/vm_kern.c
index f767f01acaa5..77d9a4105862 100644
--- a/sys/vm/vm_kern.c
+++ b/sys/vm/vm_kern.c
@@ -903,3 +903,23 @@ debug_vm_lowmem(SYSCTL_HANDLER_ARGS)
SYSCTL_PROC(_debug, OID_AUTO, vm_lowmem,
CTLTYPE_INT | CTLFLAG_MPSAFE | CTLFLAG_RW, 0, 0, debug_vm_lowmem, "I",
"set to trigger vm_lowmem event with given flags");
+
+static int
+debug_uma_reclaim(SYSCTL_HANDLER_ARGS)
+{
+ int error, i;
+
+ i = 0;
+ error = sysctl_handle_int(oidp, &i, 0, req);
+ if (error != 0)
+ return (error);
+ if (i != UMA_RECLAIM_TRIM && i != UMA_RECLAIM_DRAIN &&
+ i != UMA_RECLAIM_DRAIN_CPU)
+ return (EINVAL);
+ uma_reclaim(i);
+ return (0);
+}
+
+SYSCTL_PROC(_debug, OID_AUTO, uma_reclaim,
+ CTLTYPE_INT | CTLFLAG_MPSAFE | CTLFLAG_RW, 0, 0, debug_uma_reclaim, "I",
+ "set to generate request to reclaim uma caches");