diff --git a/lib/geom/eli/geli.8 b/lib/geom/eli/geli.8 --- a/lib/geom/eli/geli.8 +++ b/lib/geom/eli/geli.8 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 15, 2020 +.Dd April 18, 2022 .Dt GELI 8 .Os .Sh NAME @@ -886,6 +886,12 @@ This sysctl is not updated for providers that need fewer Data Keys than the limit specified in .Va kern.geom.eli.key_cache_limit . +.Va kern.geom.eli.unmapped_io +Enable support for unmapped I/O buffers, currently implemented only on 64-bit +platforms. +This is an optimization which reduces the overhead of I/O processing. +This variable is intended for debugging purposes and must be set in +.Pa /boot/loader.conf . .El .Sh EXIT STATUS Exit status is 0 on success, and 1 if the command fails. diff --git a/sys/geom/eli/g_eli.c b/sys/geom/eli/g_eli.c --- a/sys/geom/eli/g_eli.c +++ b/sys/geom/eli/g_eli.c @@ -97,15 +97,19 @@ SYSCTL_PROC(_kern_geom_eli, OID_AUTO, minbufs, CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, 0, sysctl_g_eli_minbufs, "IU", "Number of GELI bufs reserved for swap transactions"); +static bool g_eli_blocking_malloc = false; +SYSCTL_BOOL(_kern_geom_eli, OID_AUTO, blocking_malloc, CTLFLAG_RWTUN, + &g_eli_blocking_malloc, 0, "Use blocking malloc calls for GELI buffers"); +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 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; -static bool g_eli_blocking_malloc = false; -SYSCTL_BOOL(_kern_geom_eli, OID_AUTO, blocking_malloc, CTLFLAG_RWTUN, - &g_eli_blocking_malloc, 0, "Use blocking malloc calls for GELI buffers"); /* * Control the number of reserved entries in the GELI zone. @@ -1137,7 +1141,7 @@ */ pp = g_new_providerf(gp, "%s%s", bpp->name, G_ELI_SUFFIX); pp->flags |= G_PF_DIRECT_SEND | G_PF_DIRECT_RECEIVE; - if (CRYPTO_HAS_VMPAGE) { + if (g_eli_unmapped_io && CRYPTO_HAS_VMPAGE) { /* * On DMAP architectures we can use unmapped I/O. But don't * use it with data integrity verification. That code hasn't