All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: Avri Altman <avri.altman@wdc.com>,
	"James E . J . Bottomley" <jejb@linux.vnet.ibm.com>
Cc: "Martin K . Petersen" <martin.petersen@oracle.com>,
	linux-scsi@vger.kernel.org, Christoph Hellwig <hch@lst.de>,
	Bart Van Assche <bvanassche@acm.org>,
	Hannes Reinecke <hare@suse.com>,
	Yaniv Gardi <ygardi@codeaurora.org>,
	Subhash Jadavani <subhashj@codeaurora.org>,
	Stanley Chu <stanley.chu@mediatek.com>,
	Tomas Winkler <tomas.winkler@intel.com>
Subject: [PATCH RFC v2 1/5] Allow SCSI LLDs to reserve block layer tags
Date: Mon,  4 Nov 2019 16:42:22 -0800	[thread overview]
Message-ID: <20191105004226.232635-2-bvanassche@acm.org> (raw)
In-Reply-To: <20191105004226.232635-1-bvanassche@acm.org>

blk_get_request() allocates a reserved tag if BLK_MQ_REQ_RESERVED has been
set in its third argument and a regular tag if that flag has not been set.
Make it possible for SCSI LLDs to mark a subset of the blk-mq tags as
'reserved'.

Cc: Christoph Hellwig <hch@lst.de>
Cc: Hannes Reinecke <hare@suse.com>
Cc: Yaniv Gardi <ygardi@codeaurora.org>
Cc: Subhash Jadavani <subhashj@codeaurora.org>
Cc: Stanley Chu <stanley.chu@mediatek.com>
Cc: Avri Altman <avri.altman@wdc.com>
Cc: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/scsi/scsi_lib.c  | 1 +
 include/scsi/scsi_host.h | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index 2563b061f56b..b9ac7a93aafd 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -1894,6 +1894,7 @@ int scsi_mq_setup_tags(struct Scsi_Host *shost)
 		shost->tag_set.ops = &scsi_mq_ops_no_commit;
 	shost->tag_set.nr_hw_queues = shost->nr_hw_queues ? : 1;
 	shost->tag_set.queue_depth = shost->can_queue;
+	shost->tag_set.reserved_tags = shost->reserved_tags;
 	shost->tag_set.cmd_size = cmd_size;
 	shost->tag_set.numa_node = NUMA_NO_NODE;
 	shost->tag_set.flags = BLK_MQ_F_SHOULD_MERGE;
diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h
index fccdf84ec7e2..abf1f0e59919 100644
--- a/include/scsi/scsi_host.h
+++ b/include/scsi/scsi_host.h
@@ -612,6 +612,8 @@ struct Scsi_Host {
 	 * is nr_hw_queues * can_queue.
 	 */
 	unsigned nr_hw_queues;
+	/* Number of tags that blk_mq_init_queue() should consider reserved. */
+	unsigned reserved_tags;
 	unsigned active_mode:2;
 	unsigned unchecked_isa_dma:1;
 
-- 
2.24.0.rc1.363.gb1bccd3e3d-goog


  reply	other threads:[~2019-11-05  0:42 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-05  0:42 [PATCH RFC v2 0/5] Simplify and optimize the UFS driver Bart Van Assche
2019-11-05  0:42 ` Bart Van Assche [this message]
2019-11-05  0:42 ` [PATCH RFC v2 2/5] ufs: Use reserved tags for TMFs Bart Van Assche
2019-11-05  0:57   ` Christoph Hellwig
2019-11-05  1:03     ` Bart Van Assche
2019-11-05 11:58   ` [EXT] " Bean Huo (beanhuo)
2019-11-05 17:02     ` Bart Van Assche
2019-11-05 21:47       ` Bean Huo (beanhuo)
2019-11-05  0:42 ` [PATCH RFC v2 3/5] ufs: Avoid busy-waiting by eliminating tag conflicts Bart Van Assche
2019-11-05  0:42 ` [PATCH RFC v2 4/5] ufs: Use blk_{get,put}_request() to allocate and free TMFs Bart Van Assche
2019-11-05 13:50   ` [EXT] " Bean Huo (beanhuo)
2019-11-05 17:05     ` Bart Van Assche
2019-11-05 21:59       ` Bean Huo (beanhuo)
2019-11-05  0:42 ` [PATCH RFC v2 5/5] ufs: Simplify the clock scaling mechanism implementation 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=20191105004226.232635-2-bvanassche@acm.org \
    --to=bvanassche@acm.org \
    --cc=avri.altman@wdc.com \
    --cc=hare@suse.com \
    --cc=hch@lst.de \
    --cc=jejb@linux.vnet.ibm.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=stanley.chu@mediatek.com \
    --cc=subhashj@codeaurora.org \
    --cc=tomas.winkler@intel.com \
    --cc=ygardi@codeaurora.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.