ufs: core: Use a host-wide tagset in SDB mode
Subsystems (2)
Bart Van Assche
reviewerPATCH 1/1 ufs: core: Use a host-wide tagset in SDB mode
In single-doorbell (SDB) mode there is only a single request queue. Hence, it doesn't matter whether or not the SCSI host tagset is configured as host-wide. Configure the host tagset as host-wide in SDB mode because this enables a simplification of the hot path.
--- drivers/ufs/core/ufs-mcq.c | 2 -- drivers/ufs/core/ufshcd-priv.h | 7 +------ drivers/ufs/core/ufshcd.c | 1 + 3 files changed, 2 insertions(+), 8 deletions(-)
drivers/ufs/core/ufs-mcq.c +0 -2
@@ -444,7 +444,6 @@ EXPORT_SYMBOL_GPL(ufshcd_mcq_config_esi);int ufshcd_mcq_init (struct ufs_hba *hba) { -struct Scsi_Host *host = hba->host;struct ufs_hw_queue *hwq;int ret, i;
@@ -478,7 +477,6 @@ int ufshcd_mcq_init(struct ufs_hba *hba)mutex_init (&hwq->sq_mutex); } - host->host_tagset =1 ;return 0 ; }
drivers/ufs/core/ufshcd-priv.h +1 -6
@@ -374,12 +374,7 @@ static inline bool ufs_is_valid_unit_desc_lun(struct ufs_dev_info *dev_info, u8*/ static inline struct scsi_cmnd *ufshcd_tag_to_cmd (struct ufs_hba *hba,u32 tag) { -/* -* Host-wide tags are enabled in MCQ mode only. See also the -* host->host_tagset assignment in ufs-mcq.c. -*/ -struct blk_mq_tags *tags = hba->host->tag_set.shared_tags ?: - hba->host->tag_set.tags[0 ]; +struct blk_mq_tags *tags = hba->host->tag_set.shared_tags;struct request *rq =blk_mq_tag_to_rq (tags, tag);if (WARN_ON_ONCE (!rq))
drivers/ufs/core/ufshcd.c +1 -0
@@ -9320,6 +9320,7 @@ static const struct scsi_host_template ufshcd_driver_template = { .max_segment_size = PRDT_DATA_BYTE_COUNT_MAX, .max_sectors = SZ_1M / SECTOR_SIZE, .max_host_blocked = 1, + .host_tagset = true, .track_queue_depth = 1, .skip_settle_delay = 1, .sdev_groups = ufshcd_driver_groups,
Quoted 7 lines · Bart Van Assche
In single-doorbell (SDB) mode there is only a single request queue. Hence,
it doesn't matter whether or not the SCSI host tagset is configured as
host-wide. Configure the host tagset as host-wide in SDB mode because this enables a simplification of the hot path.
Hi Bart,
Would this affect the performance of the SDB mode?
drivers/ufs/core/ufshcd.c static const struct scsi_host_template · line 9324
Quoted 11 lines
drivers/ufs/core/ufshcd.c +1
-0@@ -9320,6 +9320,7 @@ static const struct scsi_host_template ufshcd_driver_template = { .max_segment_size = PRDT_DATA_BYTE_COUNT_MAX, .max_sectors = SZ_1M / SECTOR_SIZE, .max_host_blocked = 1, + .host_tagset = true,
Should be = 1?
Thanks
Peter
Quoted 3 lines
drivers/ufs/core/ufshcd.c +0
-0.track_queue_depth = 1, .skip_settle_delay = 1,.sdev_groups =
ufshcd_driver_groups,
Bart Van Assche
reviewerQuoted 9 lines · Peter Wang (王信友)
Quoted 6 lines · Bart Van Assche
In single-doorbell (SDB) mode there is only a single request queue. Hence,
it doesn't matter whether or not the SCSI host tagset is configured as
host-wide. Configure the host tagset as host-wide in SDB mode because this enables a simplification of the hot path.Would this affect the performance of the SDB mode?
Hi Peter,
I reviewed all the blk_mq_is_shared_tags() calls in the block layer. Based on that analysis I don't expect a measurable performance impact.
Quoted 4 lines
Quoted 4 lines
drivers/ufs/core/ufshcd.c +0
-0
Quoted 8 lines
drivers/ufs/core/ufshcd.c static const struct scsi_host_template · line 9324
Quoted 6 lines
drivers/ufs/core/ufshcd.c +1
-0@@ -9320,6 +9320,7 @@ static const struct scsi_host_template ufshcd_driver_template = { .max_segment_size = PRDT_DATA_BYTE_COUNT_MAX, .max_sectors = SZ_1M / SECTOR_SIZE, .max_host_blocked = 1, + .host_tagset = true,Should be = 1?
.host_tagset is used as a boolean and the compiler converts 'true' into '1' if used as an integer so I think 'true' is fine.
Thanks,
Bart.
Peter Wang (王信友)
Reviewed-byQuoted 12 lines · Bart Van Assche
Quoted 11 lines · Peter Wang (王信友)
Quoted 9 lines · Bart Van Assche
In single-doorbell (SDB) mode there is only a single request queue.
Hence,
it doesn't matter whether or not the SCSI host tagset is configured
as
host-wide. Configure the host tagset as host-wide in SDB mode because
this enables a simplification of the hot path.
Quoted 8 lines
Quoted 1 line
Would this affect the performance of the SDB mode?
Hi Peter,
I reviewed all the
blk_mq_is_shared_tags()calls in the block layer. Based on that analysis I don't expect a measurable performance impact.
Hi Bart,
After testing, it indeed does not impact performance.
Quoted 13 lines
Quoted 5 lines
Quoted 5 lines
drivers/ufs/core/ufshcd.c +0
-0Quoted 8 lines
drivers/ufs/core/ufshcd.c static const struct scsi_host_template · line 9324
Quoted 6 lines
drivers/ufs/core/ufshcd.c +1
-0@@ -9320,6 +9320,7 @@ static const struct scsi_host_template ufshcd_driver_template = { .max_segment_size = PRDT_DATA_BYTE_COUNT_MAX, .max_sectors = SZ_1M / SECTOR_SIZE, .max_host_blocked = 1, + .host_tagset = true,Should be = 1?
Quoted 7 lines
.host_tagset is used as a boolean and the compiler converts 'true' into
'1' if used as an integer so I think 'true' is fine.Thanks,
Bart.
Martin K. Petersen
AppliedBart,
Quoted 4 lines
In single-doorbell (SDB) mode there is only a single request queue. Hence, it doesn't matter whether or not the SCSI host tagset is configured as host-wide. Configure the host tagset as host-wide in SDB mode because this enables a simplification of the hot path.
Applied to 6.20/scsi-staging, thanks!
Signature · 1 line
Martin K. Petersen
Martin K. Petersen
AppliedQuoted 6 lines · Bart Van Assche
In single-doorbell (SDB) mode there is only a single request queue. Hence, it doesn't matter whether or not the SCSI host tagset is configured as host-wide. Configure the host tagset as host-wide in SDB mode because this enables a simplification of the hot path.
Applied to 6.20/scsi-queue, thanks!
[1/1] ufs: core: Use a host-wide tagset in SDB mode
https://git.kernel.org/mkp/scsi/c/4d0538dd5d7e
Signature · 1 line
Martin K. Petersen