git: c28f5f9b3e99 - stable/13 - Add sysctl debug.uma_reclaim
Konstantin Belousov
kib at FreeBSD.org
Sun Apr 11 00:56:26 UTC 2021
The branch stable/13 has been updated by kib:
URL: https://cgit.FreeBSD.org/src/commit/?id=c28f5f9b3e99e3785228e05907a00f36b249c37a
commit c28f5f9b3e99e3785228e05907a00f36b249c37a
Author: Konstantin Belousov <kib at FreeBSD.org>
AuthorDate: 2021-04-04 16:28:14 +0000
Commit: Konstantin Belousov <kib at FreeBSD.org>
CommitDate: 2021-04-11 00:35:16 +0000
Add sysctl debug.uma_reclaim
(cherry picked from commit 89619b747bcff379dca98e975a98865a45366417)
---
sys/vm/vm_kern.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/sys/vm/vm_kern.c b/sys/vm/vm_kern.c
index 8d6e4f678970..93c9e8c638bc 100644
--- a/sys/vm/vm_kern.c
+++ b/sys/vm/vm_kern.c
@@ -898,3 +898,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");
More information about the dev-commits-src-branches
mailing list