blk-mq: do not update io_ticks with passthrough requests
PATCH 1/1 blk-mq: do not update io_ticks with passthrough requests
From: Haisu Wang <[email protected]>
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.
--- block/blk-mq.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
block/blk-mq.c +2 -1
@@ -133,7 +133,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)]++;
Signature · 1 line
2.27.0
Looks good:
Quoted 8 lines · On Mon, 30 May 2022 14:40:59 +0800, [email protected] wrote:
From: Haisu Wang <[email protected]>
Flush or passthrough requests are not accounted as normal IO in completion. To reflect iostat for slow IO,
io_ticksis updated when stat show called based on inflight numbers.
It may cause inconsistentio_tickscalculation result.[...]
Applied, thanks!
[1/1] blk-mq: do not update io_ticks with passthrough requests
commit: b81c14ca14b631aa1abae32fb5ae75b5e9251012
Best regards,
Signature · 1 line
Jens Axboe