[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220613094928.134297731@linuxfoundation.org>
Date: Mon, 13 Jun 2022 12:09:59 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org, Haisu Wang <haisuwang@...cent.com>,
samuelliao <samuelliao@...cent.com>,
Christoph Hellwig <hch@....de>, Jens Axboe <axboe@...nel.dk>,
Sasha Levin <sashal@...nel.org>
Subject: [PATCH 5.17 105/298] blk-mq: do not update io_ticks with passthrough requests
From: Haisu Wang <haisuwang@...cent.com>
[ Upstream commit b81c14ca14b631aa1abae32fb5ae75b5e9251012 ]
Flush or passthrough requests are not accounted as normal IO in completion.
To reflect iostat for slow IO, io_ticks is updated when stat show called
based on inflight numbers.
It may cause inconsistent io_ticks calculation result.
So do not account non-passthrough request when check inflight.
Fixes: 86d7331299fd ("block: update io_ticks when io hang")
Signed-off-by: Haisu Wang <haisuwang@...cent.com>
Reviewed-by: samuelliao <samuelliao@...cent.com>
Reviewed-by: Christoph Hellwig <hch@....de>
Link: https://lore.kernel.org/r/20220530064059.1120058-1-haisuwang@tencent.com
Signed-off-by: Jens Axboe <axboe@...nel.dk>
Signed-off-by: Sasha Levin <sashal@...nel.org>
---
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 6afe0cd128ac..f18e1c9c3f4a 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -132,7 +132,8 @@ static bool blk_mq_check_inflight(struct request *rq, void *priv,
{
struct mq_inflight *mi = priv;
- if ((!mi->part->bd_partno || rq->part == mi->part) &&
+ if (rq->part && blk_do_io_stat(rq) &&
+ (!mi->part->bd_partno || rq->part == mi->part) &&
blk_mq_rq_state(rq) == MQ_RQ_IN_FLIGHT)
mi->inflight[rq_data_dir(rq)]++;
--
2.35.1
Powered by blists - more mailing lists