Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 4 Apr 2021 17:39:31 GMT
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 89619b747bcf - main - Add sysctl debug.uma_reclaim
Message-ID:  <202104041739.134HdVYt000621@gitrepo.freebsd.org>

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

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

commit 89619b747bcff379dca98e975a98865a45366417
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2021-04-04 16:28:14 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2021-04-04 17:39:06 +0000

    Add sysctl debug.uma_reclaim
    
    Sponsored by:   The FreeBSD Foundation
    MFC after:      1 week
---
 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 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");



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