Ping On Wed, Oct 28, 2020 at 6:59 AM Weiping Zhang <zhangweiping@xxxxxxxxxxxxxx> wrote: > > Hi, > > This patchset include two patches, > > 01. block: fix inaccurate io_ticks > fix the io_ticks if start a new IO and there is no inflight IO before. > > 02. blk-mq: break more earlier when interate hctx > An optimization for blk_mq_queue_inflight and blk_mq_part_is_in_flight > these two function only want to know if there is IO inflight and do > not care how many inflight IOs are there. > After this patch blk_mq_queue_inflight will stop interate other hctx > when find a inflight IO, blk_mq_part_is_in_inflight stop interate > other setbit/hctx when find a inflight IO. > > Changes since v4: > * only get inflight in update_io_ticks when start a new IO every jiffy. > > Changes since v3: > * add a parameter for blk_mq_queue_tag_busy_iter to break earlier > when interate hctx of a queue, since blk_mq_part_is_in_inflight > and blk_mq_queue_inflight do not care how many inflight IOs. > > Changes since v2: > * use blk_mq_queue_tag_busy_iter framework instead of open-code. > * update_io_ticks before update inflight for __part_start_io_acct > > Changes since v1: > * avoid iterate all tagset, return directly if find a set bit. > * fix some typo in commit message > > Weiping Zhang (2): > block: fix inaccurate io_ticks > blk-mq: break more earlier when interate hctx > > block/blk-core.c | 19 ++++++++++---- > block/blk-mq-tag.c | 11 ++++++-- > block/blk-mq-tag.h | 2 +- > block/blk-mq.c | 58 +++++++++++++++++++++++++++++++++++++++--- > block/blk-mq.h | 1 + > block/blk.h | 1 + > block/genhd.c | 13 ++++++++++ > include/linux/blk-mq.h | 1 + > 8 files changed, 94 insertions(+), 12 deletions(-) > > -- > 2.18.4 >