lkml.org 
[lkml]   [2022]   [Jan]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH RESEND 3/3] blk-mq: allow hardware queue to get more tag while sharing a tag set
Date
If there are multiple active queues while sharing a tag set, the
avaliable driver tag for each queue is fair share currently. However,
we found this way cause performance degradation in our environment:

A virtual machine which has 12 scsi disks on the same scsi host, each
disk represents a network disk on host machine. In virtual machine, each
disk will issue a sg io about every 15s, which will cause active queues
to be 12 before the disk is idle(blk_mq_tag_idle() is called), and io
performance is bad due to short of driver tag during that time.

Thus if there are no hctx ever failed to get driver tag, don't limit the
available driver tags as fair share. And if someone do failed to get
driver tag, fall back to fair share.

Signed-off-by: Yu Kuai <yukuai3@huawei.com>
---
block/blk-mq.h | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/block/blk-mq.h b/block/blk-mq.h
index 948791ea2a3e..4b059221b265 100644
--- a/block/blk-mq.h
+++ b/block/blk-mq.h
@@ -352,6 +352,10 @@ static inline bool hctx_may_queue(struct blk_mq_hw_ctx *hctx,
if (bt->sb.depth == 1)
return true;

+ /* Don't use fair share untill some hctx failed to get driver tag */
+ if (!atomic_read(&hctx->tags->pending_queues))
+ return true;
+
if (blk_mq_is_shared_tags(hctx->flags)) {
struct request_queue *q = hctx->queue;

--
2.31.1
\
 
 \ /
  Last update: 2022-01-17 09:45    [W:0.034 / U:2.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site