git: 0704823d1e31 - stable/14 - geli: add a read-only kern.geom.eli.use_uma_bytes sysctl

From: Alan Somers <asomers_at_FreeBSD.org>
Date: Thu, 09 May 2024 20:22:08 UTC
The branch stable/14 has been updated by asomers:

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

commit 0704823d1e319a6476ef05467abeceb0556a5ca7
Author:     Alan Somers <asomers@FreeBSD.org>
AuthorDate: 2024-04-22 18:03:40 +0000
Commit:     Alan Somers <asomers@FreeBSD.org>
CommitDate: 2024-05-09 20:20:16 +0000

    geli: add a read-only kern.geom.eli.use_uma_bytes sysctl
    
    It reports the value of the g_eli_alloc_sz variable.  Allocations of
    this size or less will use UMA.  Larger allocations will use malloc.
    Since malloc is slower, it is useful for users to know this variable so
    they can avoid such allocations.  For example, ZFS users can set
    vfs.zfs.vdev.aggregation_limit to this value.
    
    Sponsored by:   Axcient
    Reviewed by:    markj, imp
    Differential Revision: https://reviews.freebsd.org/D44904
    
    (cherry picked from commit 3acf3feaa8c5b15e820e86c1526c9a97fc5ad247)
---
 sys/geom/eli/g_eli.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/sys/geom/eli/g_eli.c b/sys/geom/eli/g_eli.c
index 16b38e628e35..400734c10596 100644
--- a/sys/geom/eli/g_eli.c
+++ b/sys/geom/eli/g_eli.c
@@ -101,11 +101,13 @@ SYSCTL_BOOL(_kern_geom_eli, OID_AUTO, blocking_malloc, CTLFLAG_RWTUN,
 static bool g_eli_unmapped_io = true;
 SYSCTL_BOOL(_kern_geom_eli, OID_AUTO, unmapped_io, CTLFLAG_RDTUN,
     &g_eli_unmapped_io, 0, "Enable support for unmapped I/O");
+static int g_eli_alloc_sz;
+SYSCTL_UINT(_kern_geom_eli, OID_AUTO, use_uma_bytes, CTLFLAG_RD,
+    &g_eli_alloc_sz, 0, "Use uma(9) for allocations of this size or smaller.");
 
 static struct sx g_eli_umalock;	/* Controls changes to UMA zone. */
 SX_SYSINIT(g_eli_umalock, &g_eli_umalock, "GELI UMA");
 static uma_zone_t g_eli_uma = NULL;
-static int g_eli_alloc_sz;
 static volatile int g_eli_umaoutstanding;
 static volatile int g_eli_devs;