From nobody Sun Jan 30 03:00:16 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 0DDF9197D042; Sun, 30 Jan 2022 03:00:17 +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 4JmbXc61blz4v6X; Sun, 30 Jan 2022 03:00:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1643511616; 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=rgY1q/y8vpH4Ru1vcVyv3SDuSwsFVKJPTpnOihkB5YM=; b=R8EfVFCk8eMHaQWr+Le4/g5L3ynmpR6bo4lsbADrvy4gZqduR29NGyz5jJVL2cS5rebtJ3 bYiMjOZsgc4TQQOtVm2iN7Oe2Rnj7/vCfr6sxIl1r7Xs+t+fO09VEhyY2dew+IVD7PzonQ PJoKkw3PbZK86GGkh/H6wEkUNncDQcDeE/dWqeAjudXpIoiEAgZdp8HM/ySjnU5w0tTLWY BsvKf+B7RHXsH6AuwY84DpEhySzSBXwO4Jwr6dNl9bRjXlCWk3V/xToxhaqMmcfL1DYLsc ZBLakOGnc52ZmQh4EIudgUD7A5qsOJb/AlzYPDGdfet41vGrkCjv90H1Vc/lcg== 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 B0623211E1; Sun, 30 Jan 2022 03:00:16 +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 20U30GJo008781; Sun, 30 Jan 2022 03:00:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 20U30G9G008770; Sun, 30 Jan 2022 03:00:16 GMT (envelope-from git) Date: Sun, 30 Jan 2022 03:00:16 GMT Message-Id: <202201300300.20U30G9G008770@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Motin Subject: git: 10ae42ccbde4 - main - GEOM: Set G_CF_DIRECT_SEND/RECEIVE for taste consumers. 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: mav X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 10ae42ccbde4fe7c8c9de3d54f3c0d63457a1a68 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1643511616; 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=rgY1q/y8vpH4Ru1vcVyv3SDuSwsFVKJPTpnOihkB5YM=; b=hA3zyjyAMxUCucCOwcBeIhHb3JfNtiDGzai//6VuyJyEAL/sNXp6AZs/vZ1RIFG2cDpU2r orhbG9CV5YR+M0W0abHdYpm+SRn3HqmkvmQP6es9c/5vwEXvYqQ/dwvyvLuotH0FmWZK/P DUCyKizva9bZs25a6WMI77sgNzmA/P+UPyfnO0wZKYZe1kC/pv28ec0OinKZmelbyECDdh Vc/VvCEMK0Rf73RvRskgbFI+PPhiIXx/IZXD15Kt5yM8GNRWvi1ouduA2B/vB+dedUi27K SqWPE0zOQ7IVUlQfL9nH01X3VAVDGGVMCYEVUNTNGg/iDiq0+FptWYJtGFxPyg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1643511616; a=rsa-sha256; cv=none; b=jMDYks5Hyq/kBDh6fMyInCOC2EhdNFHInOa2TgZbHFWve0wf01JiEwFeYcKxuycMZhyzpX Wp+/RvLA5sDwyMq5We1dD3R75nOGt4rQUIsciLQX7en29f5sRuKEc8QJ6FnX/ouzU0sI4b fqdfa/Cp8wL59YlRGikO1qeqbzu/WjhJ/7WDtTWdVVVXuy5ABWhDIK1MI6CrYnU30ybjkc SS/u1K1kLuEJymeJkbb7gvOs2IE2ZgD9sXs/umi4ZI/UIjEN/hFucGs+AnkI6shS6LpE9t pW1lMQN3pI2PFMf1HTVE5x4HRNnZUieI3hP3p3k6Z5QMSUxL4w+9tvujXS3O7Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=10ae42ccbde4fe7c8c9de3d54f3c0d63457a1a68 commit 10ae42ccbde4fe7c8c9de3d54f3c0d63457a1a68 Author: Alexander Motin AuthorDate: 2022-01-30 02:59:03 +0000 Commit: Alexander Motin CommitDate: 2022-01-30 02:59:03 +0000 GEOM: Set G_CF_DIRECT_SEND/RECEIVE for taste consumers. All I/O requests through the taste consumers are synchronous, done with g_read_data() and without any locks held. It makes no sense to delegate the I/O to g_down/g_up threads. This removes many of context switches during disk retaste. MFC after: 2 weeks --- sys/geom/cache/g_cache.c | 1 + sys/geom/concat/g_concat.c | 1 + sys/geom/journal/g_journal.c | 1 + sys/geom/linux_lvm/g_linux_lvm.c | 1 + sys/geom/mirror/g_mirror.c | 1 + sys/geom/multipath/g_multipath.c | 1 + sys/geom/raid3/g_raid3.c | 1 + sys/geom/shsec/g_shsec.c | 1 + sys/geom/stripe/g_stripe.c | 1 + sys/geom/vinum/geom_vinum.c | 1 + sys/geom/virstor/g_virstor.c | 1 + 11 files changed, 11 insertions(+) diff --git a/sys/geom/cache/g_cache.c b/sys/geom/cache/g_cache.c index 2caae5ede0f4..86c2a9bb36a2 100644 --- a/sys/geom/cache/g_cache.c +++ b/sys/geom/cache/g_cache.c @@ -673,6 +673,7 @@ g_cache_taste(struct g_class *mp, struct g_provider *pp, int flags __unused) gp->orphan = g_cache_orphan; gp->access = g_cache_access; cp = g_new_consumer(gp); + cp->flags |= G_CF_DIRECT_SEND | G_CF_DIRECT_RECEIVE; error = g_attach(cp, pp); if (error == 0) { error = g_cache_read_metadata(cp, &md); diff --git a/sys/geom/concat/g_concat.c b/sys/geom/concat/g_concat.c index c4a5e0476edf..af6109bcc2f5 100644 --- a/sys/geom/concat/g_concat.c +++ b/sys/geom/concat/g_concat.c @@ -760,6 +760,7 @@ g_concat_taste(struct g_class *mp, struct g_provider *pp, int flags __unused) gp->access = g_concat_access; gp->orphan = g_concat_orphan; cp = g_new_consumer(gp); + cp->flags |= G_CF_DIRECT_SEND | G_CF_DIRECT_RECEIVE; error = g_attach(cp, pp); if (error == 0) { error = g_concat_read_metadata(cp, &md); diff --git a/sys/geom/journal/g_journal.c b/sys/geom/journal/g_journal.c index 60c2aeb4fad6..866305ed8578 100644 --- a/sys/geom/journal/g_journal.c +++ b/sys/geom/journal/g_journal.c @@ -2481,6 +2481,7 @@ g_journal_taste(struct g_class *mp, struct g_provider *pp, int flags __unused) /* This orphan function should be never called. */ gp->orphan = g_journal_taste_orphan; cp = g_new_consumer(gp); + cp->flags |= G_CF_DIRECT_SEND | G_CF_DIRECT_RECEIVE; error = g_attach(cp, pp); if (error == 0) { error = g_journal_metadata_read(cp, &md); diff --git a/sys/geom/linux_lvm/g_linux_lvm.c b/sys/geom/linux_lvm/g_linux_lvm.c index b835baecc93d..f17827757139 100644 --- a/sys/geom/linux_lvm/g_linux_lvm.c +++ b/sys/geom/linux_lvm/g_linux_lvm.c @@ -543,6 +543,7 @@ g_llvm_taste(struct g_class *mp, struct g_provider *pp, int flags __unused) /* This orphan function should be never called. */ gp->orphan = g_llvm_taste_orphan; cp = g_new_consumer(gp); + cp->flags |= G_CF_DIRECT_SEND | G_CF_DIRECT_RECEIVE; error = g_attach(cp, pp); if (error == 0) { error = g_llvm_read_label(cp, &ll); diff --git a/sys/geom/mirror/g_mirror.c b/sys/geom/mirror/g_mirror.c index 051628e40700..94e615c8038d 100644 --- a/sys/geom/mirror/g_mirror.c +++ b/sys/geom/mirror/g_mirror.c @@ -3269,6 +3269,7 @@ g_mirror_taste(struct g_class *mp, struct g_provider *pp, int flags __unused) */ gp->orphan = g_mirror_taste_orphan; cp = g_new_consumer(gp); + cp->flags |= G_CF_DIRECT_SEND | G_CF_DIRECT_RECEIVE; error = g_attach(cp, pp); if (error == 0) { error = g_mirror_read_metadata(cp, &md); diff --git a/sys/geom/multipath/g_multipath.c b/sys/geom/multipath/g_multipath.c index ee1db72f68f9..33fcfd95925e 100644 --- a/sys/geom/multipath/g_multipath.c +++ b/sys/geom/multipath/g_multipath.c @@ -828,6 +828,7 @@ g_multipath_taste(struct g_class *mp, struct g_provider *pp, int flags __unused) gp->access = g_multipath_access; gp->orphan = g_multipath_orphan; cp = g_new_consumer(gp); + cp->flags |= G_CF_DIRECT_SEND | G_CF_DIRECT_RECEIVE; error = g_attach(cp, pp); if (error == 0) { error = g_multipath_read_metadata(cp, &md); diff --git a/sys/geom/raid3/g_raid3.c b/sys/geom/raid3/g_raid3.c index 7fcf8aa2e024..22e833c25f5d 100644 --- a/sys/geom/raid3/g_raid3.c +++ b/sys/geom/raid3/g_raid3.c @@ -3310,6 +3310,7 @@ g_raid3_taste(struct g_class *mp, struct g_provider *pp, int flags __unused) /* This orphan function should be never called. */ gp->orphan = g_raid3_taste_orphan; cp = g_new_consumer(gp); + cp->flags |= G_CF_DIRECT_SEND | G_CF_DIRECT_RECEIVE; error = g_attach(cp, pp); if (error == 0) { error = g_raid3_read_metadata(cp, &md); diff --git a/sys/geom/shsec/g_shsec.c b/sys/geom/shsec/g_shsec.c index 88add59f6d26..c1bbe69f4b8f 100644 --- a/sys/geom/shsec/g_shsec.c +++ b/sys/geom/shsec/g_shsec.c @@ -651,6 +651,7 @@ g_shsec_taste(struct g_class *mp, struct g_provider *pp, int flags __unused) gp->access = g_shsec_access; gp->orphan = g_shsec_orphan; cp = g_new_consumer(gp); + cp->flags |= G_CF_DIRECT_SEND | G_CF_DIRECT_RECEIVE; error = g_attach(cp, pp); if (error == 0) { error = g_shsec_read_metadata(cp, &md); diff --git a/sys/geom/stripe/g_stripe.c b/sys/geom/stripe/g_stripe.c index ec3bfb28b6a5..00a81e88bf3a 100644 --- a/sys/geom/stripe/g_stripe.c +++ b/sys/geom/stripe/g_stripe.c @@ -954,6 +954,7 @@ g_stripe_taste(struct g_class *mp, struct g_provider *pp, int flags __unused) gp->access = g_stripe_access; gp->orphan = g_stripe_orphan; cp = g_new_consumer(gp); + cp->flags |= G_CF_DIRECT_SEND | G_CF_DIRECT_RECEIVE; error = g_attach(cp, pp); if (error == 0) { error = g_stripe_read_metadata(cp, &md); diff --git a/sys/geom/vinum/geom_vinum.c b/sys/geom/vinum/geom_vinum.c index 0c60a051619f..86f5c9f08e1f 100644 --- a/sys/geom/vinum/geom_vinum.c +++ b/sys/geom/vinum/geom_vinum.c @@ -599,6 +599,7 @@ gv_taste(struct g_class *mp, struct g_provider *pp, int flags __unused) sc = gp->softc; cp = g_new_consumer(gp); + cp->flags |= G_CF_DIRECT_SEND | G_CF_DIRECT_RECEIVE; if (g_attach(cp, pp) != 0) { g_destroy_consumer(cp); return (NULL); diff --git a/sys/geom/virstor/g_virstor.c b/sys/geom/virstor/g_virstor.c index 6c201b24ab19..93f103cadb6d 100644 --- a/sys/geom/virstor/g_virstor.c +++ b/sys/geom/virstor/g_virstor.c @@ -780,6 +780,7 @@ g_virstor_taste(struct g_class *mp, struct g_provider *pp, int flags) gp->orphan = (void *)invalid_call; /* I really want these to fail. */ cp = g_new_consumer(gp); + cp->flags |= G_CF_DIRECT_SEND | G_CF_DIRECT_RECEIVE; error = g_attach(cp, pp); if (error == 0) { error = read_metadata(cp, &md);