Linux-Block Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] blk-mq: insert request not through ->queue_rq into sw/scheduler queue
@ 2020-07-29  7:24 Ming Lei
  2020-08-04  7:41 ` Ming Lei
  0 siblings, 1 reply; 2+ messages in thread
From: Ming Lei @ 2020-07-29  7:24 UTC (permalink / raw)
  To: Jens Axboe, Christoph Hellwig
  Cc: linux-block, Ming Lei, Bart Van Assche, Mike Snitzer

c616cbee97ae ("blk-mq: punt failed direct issue to dispatch list") supposed
to add request which has been through ->queue_rq() to the hw queue dispatch
list, however it adds request running out of budget or driver tag to hw queue
too. This way basically bypasses request merge, and causes too many request
dispatched to LLD, and system% is unnecessary increased.

Fixes this issue by adding request not through ->queue_rq into sw/scheduler
queue, and this way is safe because no ->queue_rq is called on this request
yet.

High %system can be observed on Azure storvsc device, and even soft lock
is observed. This patch reduces %system during heavy sequential IO,
meantime decreases soft lockup risk.

Cc: Bart Van Assche <bvanassche@acm.org>
Cc: Mike Snitzer <snitzer@redhat.com>
Fixes: c616cbee97ae ("blk-mq: punt failed direct issue to dispatch list")
Signed-off-by: Ming Lei <ming.lei@redhat.com>
---
 block/blk-mq.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/block/blk-mq.c b/block/blk-mq.c
index c3856377b961..b356d4d3ca0b 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -2016,7 +2016,8 @@ static blk_status_t __blk_mq_try_issue_directly(struct blk_mq_hw_ctx *hctx,
 	if (bypass_insert)
 		return BLK_STS_RESOURCE;
 
-	blk_mq_request_bypass_insert(rq, false, run_queue);
+	blk_mq_sched_insert_request(rq, false, run_queue, false);
+
 	return BLK_STS_OK;
 }
 
-- 
2.25.2


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

* Re: [PATCH] blk-mq: insert request not through ->queue_rq into sw/scheduler queue
  2020-07-29  7:24 [PATCH] blk-mq: insert request not through ->queue_rq into sw/scheduler queue Ming Lei
@ 2020-08-04  7:41 ` Ming Lei
  0 siblings, 0 replies; 2+ messages in thread
From: Ming Lei @ 2020-08-04  7:41 UTC (permalink / raw)
  To: Jens Axboe, Christoph Hellwig; +Cc: linux-block, Bart Van Assche, Mike Snitzer

On Wed, Jul 29, 2020 at 03:24:49PM +0800, Ming Lei wrote:
> c616cbee97ae ("blk-mq: punt failed direct issue to dispatch list") supposed
> to add request which has been through ->queue_rq() to the hw queue dispatch
> list, however it adds request running out of budget or driver tag to hw queue
> too. This way basically bypasses request merge, and causes too many request
> dispatched to LLD, and system% is unnecessary increased.
> 
> Fixes this issue by adding request not through ->queue_rq into sw/scheduler
> queue, and this way is safe because no ->queue_rq is called on this request
> yet.
> 
> High %system can be observed on Azure storvsc device, and even soft lock
> is observed. This patch reduces %system during heavy sequential IO,
> meantime decreases soft lockup risk.
> 
> Cc: Bart Van Assche <bvanassche@acm.org>
> Cc: Mike Snitzer <snitzer@redhat.com>
> Fixes: c616cbee97ae ("blk-mq: punt failed direct issue to dispatch list")
> Signed-off-by: Ming Lei <ming.lei@redhat.com>
> ---
>  block/blk-mq.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/block/blk-mq.c b/block/blk-mq.c
> index c3856377b961..b356d4d3ca0b 100644
> --- a/block/blk-mq.c
> +++ b/block/blk-mq.c
> @@ -2016,7 +2016,8 @@ static blk_status_t __blk_mq_try_issue_directly(struct blk_mq_hw_ctx *hctx,
>  	if (bypass_insert)
>  		return BLK_STS_RESOURCE;
>  
> -	blk_mq_request_bypass_insert(rq, false, run_queue);
> +	blk_mq_sched_insert_request(rq, false, run_queue, false);
> +
>  	return BLK_STS_OK;
>  }
>  

Hello Guys,

Ping...


thanks, 
Ming


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

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-29  7:24 [PATCH] blk-mq: insert request not through ->queue_rq into sw/scheduler queue Ming Lei
2020-08-04  7:41 ` Ming Lei

Linux-Block Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-block/0 linux-block/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-block linux-block/ https://lore.kernel.org/linux-block \
		linux-block@vger.kernel.org
	public-inbox-index linux-block

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-block


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git