git: 565ad82c4531 - stable/13 - glabel: Set G_CF_DIRECT_SEND/RECEIVE for taste consumer.

From: Alexander Motin <mav_at_FreeBSD.org>
Date: Fri, 11 Feb 2022 01:10:40 UTC
The branch stable/13 has been updated by mav:

URL: https://cgit.FreeBSD.org/src/commit/?id=565ad82c453170009a58431399301dec44b56ad7

commit 565ad82c453170009a58431399301dec44b56ad7
Author:     Alexander Motin <mav@FreeBSD.org>
AuthorDate: 2022-01-28 19:22:41 +0000
Commit:     Alexander Motin <mav@FreeBSD.org>
CommitDate: 2022-02-11 00:50:46 +0000

    glabel: Set G_CF_DIRECT_SEND/RECEIVE for taste consumer.
    
    All I/O requests through the taste consumer 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
    
    (cherry picked from commit 29998bf2ac4cc3ac49827336655bdbcb755eeffc)
---
 sys/geom/label/g_label.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sys/geom/label/g_label.c b/sys/geom/label/g_label.c
index 1df7e799b014..2244931cd19b 100644
--- a/sys/geom/label/g_label.c
+++ b/sys/geom/label/g_label.c
@@ -402,6 +402,7 @@ g_label_taste(struct g_class *mp, struct g_provider *pp, int flags __unused)
 	gp->access = g_label_access_taste;
 	gp->orphan = g_label_orphan_taste;
 	cp = g_new_consumer(gp);
+	cp->flags |= G_CF_DIRECT_SEND | G_CF_DIRECT_RECEIVE;
 	if (g_attach(cp, pp) != 0)
 		goto end2;
 	if (g_access(cp, 1, 0, 0) != 0)