[Devel] [PATCH rh7] blk-mq: skip requests which have not been started yet

Konstantin Khorenko khorenko at virtuozzo.com
Fri Jun 14 14:22:39 MSK 2019


Nodes with NVMe disks show 99% iowait on RHEL7.6-based kernels,
this patch should fix it.

The patch is provided by RedHat in their bugzilla.

https://jira.sw.ru/browse/PSBM-95470
https://bugs.openvz.org/browse/OVZ-7105
https://bugs.centos.org/view.php?id=15723
https://bugzilla.redhat.com/show_bug.cgi?id=1671551

Signed-off-by: Konstantin Khorenko <khorenko at virtuozzo.com>
---
 block/blk-mq.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/block/blk-mq.c b/block/blk-mq.c
index 58363a7f68e4..e529ecaab188 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -76,6 +76,9 @@ static void blk_mq_check_inflight(struct blk_mq_hw_ctx *hctx,
 {
 	struct mq_inflight *mi = priv;
 
+	if (!blk_mq_request_started(rq))
+		return;
+
 	/*
 	 * index[0] counts the specific partition that was asked
 	 * for. index[1] counts the ones that are active on the
@@ -103,6 +106,9 @@ static void blk_mq_check_inflight_rw(struct blk_mq_hw_ctx *hctx,
 {
 	struct mq_inflight *mi = priv;
 
+	if (!blk_mq_request_started(rq))
+		return;
+
 	if (rq->part == mi->part)
 		mi->inflight[rq_data_dir(rq)]++;
 }
-- 
2.15.1



More information about the Devel mailing list