public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/3] mmc: block: Limit queue size for consecutive requeues
@ 2022-10-26  7:30 Christian Löhle
  2022-11-18 11:32 ` Adrian Hunter
  0 siblings, 1 reply; 2+ messages in thread
From: Christian Löhle @ 2022-10-26  7:30 UTC (permalink / raw)
  To: axboe@kernel.dk, ulf.hansson@linaro.org,
	linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-block@vger.kernel.org
  Cc: Avri Altman, adrian.hunter@intel.com, vincent.whitchurch@axis.com,
	Christian Löhle

In case mmcblk relies on requeueing to fulfill block layer requests due to
hardware or driver restricting the max_blk_count to 1 also limit the
hardware queue size to 1 to get consecutive accesses instead of a
round-robin on all queued reads.

See SDHCI_QUIRK_NO_MULTIBLOCK for such a restriction.

Signed-off-by: Christian Loehle <cloehle@hyperstone.com>
---
 drivers/mmc/core/queue.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/mmc/core/queue.c b/drivers/mmc/core/queue.c
index fefaa901b50f..3a20f3933502 100644
--- a/drivers/mmc/core/queue.c
+++ b/drivers/mmc/core/queue.c
@@ -425,6 +425,8 @@ struct gendisk *mmc_init_queue(struct mmc_queue *mq, struct mmc_card *card)
 	if (host->cqe_enabled && !host->hsq_enabled)
 		mq->tag_set.queue_depth =
 			min_t(int, card->ext_csd.cmdq_depth, host->cqe_qdepth);
+	else if (host->max_blk_count == 1)
+		mq->tag_set.queue_depth = 1;
 	else
 		mq->tag_set.queue_depth = MMC_QUEUE_DEPTH;
 	mq->tag_set.numa_node = NUMA_NO_NODE;
-- 
2.37.3

Hyperstone GmbH | Reichenaustr. 39a  | 78467 Konstanz
Managing Director: Dr. Jan Peter Berns.
Commercial register of local courts: Freiburg HRB381782


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 2/3] mmc: block: Limit queue size for consecutive requeues
  2022-10-26  7:30 [PATCH 2/3] mmc: block: Limit queue size for consecutive requeues Christian Löhle
@ 2022-11-18 11:32 ` Adrian Hunter
  0 siblings, 0 replies; 2+ messages in thread
From: Adrian Hunter @ 2022-11-18 11:32 UTC (permalink / raw)
  To: Christian Löhle, axboe@kernel.dk, ulf.hansson@linaro.org,
	linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-block@vger.kernel.org, Christoph Hellwig
  Cc: Avri Altman, vincent.whitchurch@axis.com

On 26/10/22 10:30, Christian Löhle wrote:
> In case mmcblk relies on requeueing to fulfill block layer requests due to
> hardware or driver restricting the max_blk_count to 1 also limit the
> hardware queue size to 1 to get consecutive accesses instead of a
> round-robin on all queued reads.
> 
> See SDHCI_QUIRK_NO_MULTIBLOCK for such a restriction.
> 
> Signed-off-by: Christian Loehle <cloehle@hyperstone.com>
> ---
>  drivers/mmc/core/queue.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/mmc/core/queue.c b/drivers/mmc/core/queue.c
> index fefaa901b50f..3a20f3933502 100644
> --- a/drivers/mmc/core/queue.c
> +++ b/drivers/mmc/core/queue.c
> @@ -425,6 +425,8 @@ struct gendisk *mmc_init_queue(struct mmc_queue *mq, struct mmc_card *card)
>  	if (host->cqe_enabled && !host->hsq_enabled)
>  		mq->tag_set.queue_depth =
>  			min_t(int, card->ext_csd.cmdq_depth, host->cqe_qdepth);
> +	else if (host->max_blk_count == 1)

I suggest adding a big comment here about why this is needed.
Perhaps like the information in your cover letter email.

> +		mq->tag_set.queue_depth = 1;
>  	else
>  		mq->tag_set.queue_depth = MMC_QUEUE_DEPTH;
>  	mq->tag_set.numa_node = NUMA_NO_NODE;


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-11-18 11:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-26  7:30 [PATCH 2/3] mmc: block: Limit queue size for consecutive requeues Christian Löhle
2022-11-18 11:32 ` Adrian Hunter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox