From nobody Mon Apr 18 21:55:47 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 0216F11DE737; Mon, 18 Apr 2022 21:55:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Kj12q6cJDz3NW2; Mon, 18 Apr 2022 21:55:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1650318947; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZcxiEULItNxCll/+VhNeFmhrsAi15k4BII/zOmYtfKY=; b=WLI99lCXBFdnps/lvorA6OMOBUrfiez+mfv2L0BQnlOoYxg6VPqmYaPcC0jfVx5nUwr6wZ E1d1wEPHzFDmHZ92DaEHE4ie8OvKtRzYsTyxutNz5mASOMGmVGyCgGYNRiCK0U2bMhnoim xOAzNbnOEfZVPJlbQlpUScJWzPdh4/6tlDFY4wUQduNMw1yz7JkIMhiubuqDcY4LnXHhoJ crzvEqnFNWhY+Zfhxq+E2cp/u4MStozBf+11IkLx83sE962yiyHzkc98Sv6z7HG5ua5VMj /srhpQK0PD5drlulTEMrKpbKh1dh+sdR2+Sc5lQjRdQKbHlclxKVrtvTQSuqdA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BE6FE1AE2D; Mon, 18 Apr 2022 21:55:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 23ILtlvB018417; Mon, 18 Apr 2022 21:55:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 23ILtlad018416; Mon, 18 Apr 2022 21:55:47 GMT (envelope-from git) Date: Mon, 18 Apr 2022 21:55:47 GMT Message-Id: <202204182155.23ILtlad018416@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 081b4452a758 - main - geli: Add a chicken switch for unmapped I/O List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 081b4452a758dd81dcdc68ffb6f7bad901d53e3d Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1650318947; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZcxiEULItNxCll/+VhNeFmhrsAi15k4BII/zOmYtfKY=; b=lmwVkqeqRPxZ8/q+UJNWo2lctNBsJQbjnaHZGN5WJOq41FuZBsm5mJ3P4y1OPgtuJnEv0q XKDNv19Xj9cxvsietZqGncS/Domm3fmjoWcZsRYH2AulPHvsOf0XnL6cIJCqX9c22r3GSv 8qhFemGXRsAzMny1n6tJh4ijn2lwoA4ll6TVhNtQ2OZZn5/ZmNBqTFlk11iuw7QZDUCq89 8ec33+VHXIiEIIdS773InvIJOD/sb1+hoy+A1Z5HSnYeffntfUfwbOB9f08l53RSUfcBLG 2KlsW/Z9PmrN3IubmOML1M4BC5kVsRVaCRKNZ+Id7HB3XGcGzE8eJYDG0zqw4w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1650318947; a=rsa-sha256; cv=none; b=bjTzUfuf7xsgL01ZnGRMKngUTCs1amyrWrBYqy8Qjw/KHRCploXOCtIfzuuQKVOhvAroFV mlIaDtFtYKMhcWWSH8+sgvw0LLlUg5asjs73KWUQ0GVNQ3sj8WHy6gA9KhD0sskVPb5bQa Iahqa+uX7qtg7qKlcT0HYQFttjAZRkvZdR91l/M9e++fQorS+Ihzwgd0Lrci8WpKoXjChQ GMpNM4dC+RAp/V6X35RS4V6RPUIpjHYC+mRWxAK6cBXEsXRQMLLZNZTm2mxxe1okDPigXK qwFc1TZwVuyrODVxQ4t/lfbmoZs56B2Gwg1i6P457Px4+9xb+loowSiH6cMJhQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=081b4452a758dd81dcdc68ffb6f7bad901d53e3d commit 081b4452a758dd81dcdc68ffb6f7bad901d53e3d Author: Mark Johnston AuthorDate: 2022-04-18 21:16:10 +0000 Commit: Mark Johnston CommitDate: 2022-04-18 21:55:24 +0000 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 --- lib/geom/eli/geli.8 | 8 +++++++- sys/geom/eli/g_eli.c | 12 ++++++++---- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/lib/geom/eli/geli.8 b/lib/geom/eli/geli.8 index 68018e8022cd..1ad0c684642b 100644 --- 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 @@ Reports how many times we were looking up a Data Key and it was not in cache. 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 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