lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220117085455.2269760-4-yukuai3@huawei.com>
Date:   Mon, 17 Jan 2022 16:54:55 +0800
From:   Yu Kuai <yukuai3@...wei.com>
To:     <axboe@...nel.dk>
CC:     <linux-block@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
        <yukuai3@...wei.com>, <yi.zhang@...wei.com>
Subject: [PATCH RESEND 3/3] blk-mq: allow hardware queue to get more tag while sharing a tag set

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@...wei.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ