Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 11 Apr 2021 00:56:25 GMT
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: c28f5f9b3e99 - stable/13 - Add sysctl debug.uma_reclaim
Message-ID:  <202104110056.13B0uPXT014310@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by kib:

URL: https://cgit.FreeBSD.org/src/commit/?id=c28f5f9b3e99e3785228e05907a00f36b249c37a

commit c28f5f9b3e99e3785228e05907a00f36b249c37a
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2021-04-04 16:28:14 +0000
Commit:     Konstantin Belousov <kib@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");



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202104110056.13B0uPXT014310>