From: Bart Van Assche <bvanassche@acm.org>
To: Jens Axboe <axboe@kernel.dk>
Cc: linux-block@vger.kernel.org, linux-scsi@vger.kernel.org,
"Martin K . Petersen" <martin.petersen@oracle.com>,
Christoph Hellwig <hch@lst.de>,
Bart Van Assche <bvanassche@acm.org>,
Ming Lei <ming.lei@redhat.com>, Keith Busch <kbusch@kernel.org>,
Damien Le Moal <damien.lemoal@opensource.wdc.com>,
Yu Kuai <yukuai1@huaweicloud.com>, Ed Tsai <ed.tsai@mediatek.com>,
"James E.J. Bottomley" <jejb@linux.ibm.com>,
Matthias Brugger <matthias.bgg@gmail.com>,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com>
Subject: [PATCH v6 2/4] scsi: core: Make fair tag sharing configurable in the host template
Date: Thu, 30 Nov 2023 11:31:29 -0800 [thread overview]
Message-ID: <20231130193139.880955-3-bvanassche@acm.org> (raw)
In-Reply-To: <20231130193139.880955-1-bvanassche@acm.org>
Allow SCSI drivers to disable the block layer fair tag sharing algorithm
via the SCSI host template.
Cc: Martin K. Petersen <martin.petersen@oracle.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Ming Lei <ming.lei@redhat.com>
Cc: Keith Busch <kbusch@kernel.org>
Cc: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Cc: Yu Kuai <yukuai1@huaweicloud.com>
Cc: Ed Tsai <ed.tsai@mediatek.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
drivers/scsi/hosts.c | 1 +
drivers/scsi/scsi_lib.c | 2 ++
include/scsi/scsi_host.h | 6 ++++++
3 files changed, 9 insertions(+)
diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c
index d7f51b84f3c7..872f87001374 100644
--- a/drivers/scsi/hosts.c
+++ b/drivers/scsi/hosts.c
@@ -442,6 +442,7 @@ struct Scsi_Host *scsi_host_alloc(const struct scsi_host_template *sht, int priv
shost->no_write_same = sht->no_write_same;
shost->host_tagset = sht->host_tagset;
shost->queuecommand_may_block = sht->queuecommand_may_block;
+ shost->disable_fair_tag_sharing = sht->disable_fair_tag_sharing;
if (shost_eh_deadline == -1 || !sht->eh_host_reset_handler)
shost->eh_deadline = -1;
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index cf3864f72093..291fbfacf542 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -1984,6 +1984,8 @@ int scsi_mq_setup_tags(struct Scsi_Host *shost)
BLK_ALLOC_POLICY_TO_MQ_FLAG(shost->hostt->tag_alloc_policy);
if (shost->queuecommand_may_block)
tag_set->flags |= BLK_MQ_F_BLOCKING;
+ if (shost->disable_fair_tag_sharing)
+ tag_set->flags |= BLK_MQ_F_DISABLE_FAIR_TAG_SHARING;
tag_set->driver_data = shost;
if (shost->host_tagset)
tag_set->flags |= BLK_MQ_F_TAG_HCTX_SHARED;
diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h
index 3b907fc2ef08..04238ae9e22c 100644
--- a/include/scsi/scsi_host.h
+++ b/include/scsi/scsi_host.h
@@ -464,6 +464,9 @@ struct scsi_host_template {
/* The queuecommand callback may block. See also BLK_MQ_F_BLOCKING. */
unsigned queuecommand_may_block:1;
+ /* See also BLK_MQ_F_DISABLE_FAIR_TAG_SHARING. */
+ unsigned disable_fair_tag_sharing:1;
+
/*
* Countdown for host blocking with no commands outstanding.
*/
@@ -662,6 +665,9 @@ struct Scsi_Host {
/* The queuecommand callback may block. See also BLK_MQ_F_BLOCKING. */
unsigned queuecommand_may_block:1;
+ /* See also BLK_MQ_F_DISABLE_FAIR_TAG_SHARING. */
+ unsigned disable_fair_tag_sharing:1;
+
/* Host responded with short (<36 bytes) INQUIRY result */
unsigned short_inquiry:1;
next prev parent reply other threads:[~2023-11-30 19:31 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-30 19:31 [PATCH v6 0/6] Disable fair tag sharing for UFS devices Bart Van Assche
2023-11-30 19:31 ` [PATCH v6 1/4] block: Make fair tag sharing configurable Bart Van Assche
2023-12-01 12:52 ` Johannes Thumshirn
2023-12-01 22:14 ` Bart Van Assche
2023-12-02 7:21 ` Yu Kuai
2023-12-04 4:13 ` Bart Van Assche
2023-12-25 12:51 ` Yu Kuai
2023-12-26 2:22 ` Bart Van Assche
2024-01-11 19:22 ` Bart Van Assche
2024-01-12 1:08 ` Yu Kuai
2024-01-12 4:39 ` Christoph Hellwig
2024-01-14 3:22 ` Yu Kuai
2024-01-15 5:59 ` Christoph Hellwig
2024-01-15 6:18 ` Yu Kuai
2024-01-16 2:59 ` Bart Van Assche
2024-01-16 10:24 ` Yu Kuai
2024-01-16 17:36 ` Bart Van Assche
2024-01-18 7:31 ` Christoph Hellwig
2024-01-18 18:40 ` Bart Van Assche
2024-01-23 9:13 ` Christoph Hellwig
2024-01-23 15:16 ` Bart Van Assche
2024-01-24 9:08 ` Christoph Hellwig
2024-01-30 0:03 ` Bart Van Assche
2024-01-31 6:22 ` Christoph Hellwig
2024-01-31 21:32 ` Bart Van Assche
2024-01-31 21:37 ` Keith Busch
2024-01-31 21:42 ` Bart Van Assche
2024-01-31 23:04 ` Keith Busch
2024-01-31 23:41 ` Bart Van Assche
2024-01-31 23:52 ` Damien Le Moal
2024-01-16 2:52 ` Bart Van Assche
2023-11-30 19:31 ` Bart Van Assche [this message]
2023-11-30 19:31 ` [PATCH v6 3/4] scsi: core: Make fair tag sharing configurable via sysfs Bart Van Assche
2023-11-30 19:31 ` [PATCH v6 4/4] scsi: ufs: Disable fair tag sharing Bart Van Assche
2023-12-04 7:52 ` [PATCH v6 0/6] Disable fair tag sharing for UFS devices Christoph Hellwig
2023-12-05 3:15 ` Bart Van Assche
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231130193139.880955-3-bvanassche@acm.org \
--to=bvanassche@acm.org \
--cc=angelogioacchino.delregno@collabora.com \
--cc=axboe@kernel.dk \
--cc=damien.lemoal@opensource.wdc.com \
--cc=ed.tsai@mediatek.com \
--cc=hch@lst.de \
--cc=jejb@linux.ibm.com \
--cc=kbusch@kernel.org \
--cc=linux-block@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=matthias.bgg@gmail.com \
--cc=ming.lei@redhat.com \
--cc=yukuai1@huaweicloud.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).