aboutsummaryrefslogtreecommitdiff
path: root/sys/geom
diff options
context:
space:
mode:
authorMark Johnston <markj@FreeBSD.org>2022-04-18 21:16:10 +0000
committerMark Johnston <markj@FreeBSD.org>2022-04-18 21:55:24 +0000
commit081b4452a758dd81dcdc68ffb6f7bad901d53e3d (patch)
treef8a3e9f9e31df283438fbbf21d4ddea9d2842c80 /sys/geom
parentcc9e6590773dba57440750c124173ed531349a06 (diff)
downloadsrc-081b4452a758dd81dcdc68ffb6f7bad901d53e3d.tar.gz
src-081b4452a758dd81dcdc68ffb6f7bad901d53e3d.zip
geli: Add a chicken switch for unmapped I/O
We have a report of a panic in GELI that appears to go away when unmapped I/O is disabled. Add a tunable to make such investigations easier in the future. No functional change intended. PR: 262894 Reviewed by: asomers MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D34944
Diffstat (limited to 'sys/geom')
-rw-r--r--sys/geom/eli/g_eli.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/sys/geom/eli/g_eli.c b/sys/geom/eli/g_eli.c
index 74dd5de3dc83..ac25be604932 100644
--- a/sys/geom/eli/g_eli.c
+++ b/sys/geom/eli/g_eli.c
@@ -97,15 +97,19 @@ static int sysctl_g_eli_minbufs(SYSCTL_HANDLER_ARGS);
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 @@ g_eli_create(struct gctl_req *req, struct g_class *mp, struct g_provider *bpp,
*/
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