提交 a9ee8ebe 编写于 作者: X Xiaoguang Wang 提交者: Caspar Zhang

alinux: blk-mq: fix broken io_ticks & time_in_queue update

fix #25369772

In blk-mq device, we observed a issue that though iops is low, but iostat
shows a very high svctm & util value, which is counter-intuitive.

The root cause is that blk_account_io_start() calls part_round_stats()
before "rq->part = part" statement, so part_round_stats() will count
an inflight request to the whole device, but not for the specific
partition, then it'll update whole device's io_ticks and time_in_queue
with a stale part->stamp.

To fix this issue, if a request's part is NULL, we just don't count
it as an inflight request to the whole device.
Signed-off-by: NXiaoguang Wang <xiaoguang.wang@linux.alibaba.com>
Reviewed-by: NJoseph Qi <joseph.qi@linux.alibaba.com>
上级 6073719d
...@@ -106,7 +106,7 @@ static void blk_mq_check_inflight(struct blk_mq_hw_ctx *hctx, ...@@ -106,7 +106,7 @@ static void blk_mq_check_inflight(struct blk_mq_hw_ctx *hctx,
*/ */
if (rq->part == mi->part) if (rq->part == mi->part)
mi->inflight[0]++; mi->inflight[0]++;
if (mi->part->partno) if (rq->part && mi->part->partno)
mi->inflight[1]++; mi->inflight[1]++;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册