All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next RFC 0/6] improve large random io for HDD
@ 2022-03-29  9:40 Yu Kuai
  2022-03-29  9:40 ` [PATCH -next RFC 1/6] blk-mq: add a new flag 'BLK_MQ_F_NO_TAG_PREEMPTION' Yu Kuai
                   ` (6 more replies)
  0 siblings, 7 replies; 20+ messages in thread
From: Yu Kuai @ 2022-03-29  9:40 UTC (permalink / raw)
  To: axboe, andriy.shevchenko, john.garry, ming.lei
  Cc: linux-block, linux-kernel, yukuai3, yi.zhang

There is a defect for blk-mq compare to blk-sq, specifically split io
will end up discontinuous if the device is under high io pressure, while
split io will still be continuous in sq, this is because:

1) split bio is issued one by one, if one bio can't get tag, it will go
to wail. - patch 2
2) each time 8(or wake batch) requests is done, 8 waiters will be woken up.
Thus if a thread is woken up, it will unlikey to get multiple tags.
- patch 3,4
3) new io can preempt tag even if there are lots of threads waiting for
tags. - patch 5

Test environment:
x86 vm, nr_requests is set to 64, queue_depth is set to 32 and
max_sectors_kb is set to 128.

I haven't tested this patchset on physical machine yet, I'll try later
if anyone thinks this approch is meaningful.

Fio test cmd:
[global]
filename=/dev/sda
ioengine=libaio
direct=1
offset_increment=100m

[test]
rw=randwrite
bs=512k
numjobs=256
iodepth=2

Result: raito of sequential io(calculated from log by blktrace)
original:
21%
patched: split io thoroughly and wake up based on required tags.
40%
patched and set flag: disable tag preemption.
69%

Yu Kuai (6):
  blk-mq: add a new flag 'BLK_MQ_F_NO_TAG_PREEMPTION'
  block: refactor to split bio thoroughly
  blk-mq: record how many tags are needed for splited bio
  sbitmap: wake up the number of threads based on required tags
  blk-mq: don't preempt tag expect for split bios
  sbitmap: force tag preemption if free tags are sufficient

 block/bio.c               |  2 +
 block/blk-merge.c         | 95 ++++++++++++++++++++++++++++-----------
 block/blk-mq-debugfs.c    |  1 +
 block/blk-mq-tag.c        | 39 +++++++++++-----
 block/blk-mq.c            | 14 +++++-
 block/blk-mq.h            |  7 +++
 block/blk.h               |  3 +-
 include/linux/blk-mq.h    |  7 ++-
 include/linux/blk_types.h |  6 +++
 include/linux/sbitmap.h   |  8 ++++
 lib/sbitmap.c             | 33 +++++++++++++-
 11 files changed, 173 insertions(+), 42 deletions(-)

-- 
2.31.1


^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2022-03-30  2:07 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-29  9:40 [PATCH -next RFC 0/6] improve large random io for HDD Yu Kuai
2022-03-29  9:40 ` [PATCH -next RFC 1/6] blk-mq: add a new flag 'BLK_MQ_F_NO_TAG_PREEMPTION' Yu Kuai
2022-03-29 12:44   ` Jens Axboe
2022-03-30  1:18     ` yukuai (C)
2022-03-30  1:20       ` Jens Axboe
2022-03-29  9:40 ` [PATCH -next RFC 2/6] block: refactor to split bio thoroughly Yu Kuai
2022-03-29 12:46   ` Jens Axboe
2022-03-30  1:35     ` yukuai (C)
2022-03-29 13:32   ` Christoph Hellwig
2022-03-29 14:35     ` Jens Axboe
2022-03-29 14:40       ` Christoph Hellwig
2022-03-29 14:41         ` Jens Axboe
2022-03-29 14:42           ` Christoph Hellwig
2022-03-30  1:54           ` yukuai (C)
2022-03-29  9:40 ` [PATCH -next RFC 3/6] blk-mq: record how many tags are needed for splited bio Yu Kuai
2022-03-29  9:40 ` [PATCH -next RFC 4/6] sbitmap: wake up the number of threads based on required tags Yu Kuai
2022-03-29  9:40 ` [PATCH -next RFC 5/6] blk-mq: don't preempt tag expect for split bios Yu Kuai
2022-03-29  9:40 ` [PATCH -next RFC 6/6] sbitmap: force tag preemption if free tags are sufficient Yu Kuai
2022-03-29 12:53 ` [PATCH -next RFC 0/6] improve large random io for HDD Jens Axboe
2022-03-30  2:05   ` yukuai (C)

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.