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

Submitted by Konstantin Khorenko on June 14, 2019, 11:22 a.m.

Details

Message ID 20190614112239.18594-1-khorenko@virtuozzo.com
State New
Series "blk-mq: skip requests which have not been started yet"
Headers show

Commit Message

Konstantin Khorenko June 14, 2019, 11:22 a.m.
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@virtuozzo.com>
---
 block/blk-mq.c | 6 ++++++
 1 file changed, 6 insertions(+)

Patch hide | download patch | download mbox

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)]++;
 }