Add sysctl debug.uma_reclaim

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
This commit is contained in:
Konstantin Belousov 2021-04-04 19:28:14 +03:00
parent 51a7be5f60
commit 89619b747b

View File

@ -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");