cgroups.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RFC v2 0/5] blk-mq-sched: support request batch dispatching for sq elevator
@ 2025-06-14  9:25 Yu Kuai
  2025-06-14  9:25 ` [PATCH RFC v2 1/5] elevator: introduce global lock for sq_shared elevator Yu Kuai
                   ` (5 more replies)
  0 siblings, 6 replies; 15+ messages in thread
From: Yu Kuai @ 2025-06-14  9:25 UTC (permalink / raw)
  To: ming.lei, yukuai3, tj, josef, axboe
  Cc: linux-block, cgroups, linux-kernel, yukuai1, yi.zhang, yangerkun,
	johnny.chenyi

From: Yu Kuai <yukuai3@huawei.com>

Before this patch, each dispatch context will hold a global lock to
dispatch one request at a time, which introduce intense lock competition:

lock
ops.dispatch_request
unlock

Hence support dispatch a batch of requests while holding the lock to
reduce lock contention.

nullblk setup:
modprobe null_blk nr_devices=0 &&
    udevadm settle &&
    cd /sys/kernel/config/nullb &&
    mkdir nullb0 &&
    cd nullb0 &&
    echo 0 > completion_nsec &&
    echo 512 > blocksize &&
    echo 0 > home_node &&
    echo 0 > irqmode &&
    echo 128 > submit_queues &&
    echo 1024 > hw_queue_depth &&
    echo 1024 > size &&
    echo 0 > memory_backed &&
    echo 2 > queue_mode &&
    echo 1 > power ||
    exit $?

Test script:
fio -filename=/dev/$disk -name=test -rw=randwrite -bs=4k -iodepth=32 \
  -numjobs=16 --iodepth_batch_submit=8 --iodepth_batch_complete=8 \
  -direct=1 -ioengine=io_uring -group_reporting -time_based -runtime=30

Test result(elevator is deadline): iops
|                 | null_blk | scsi hdd |
| --------------- | -------- | -------- |
| before this set | 263k     | 24       |
| after this set  | 475k     | 272      |

Yu Kuai (5):
  elevator: introduce global lock for sq_shared elevator
  mq-deadline: switch to use elevator lock
  block, bfq: switch to use elevator lock
  blk-mq-sched: refactor __blk_mq_do_dispatch_sched()
  blk-mq-sched: support request batch dispatching for sq elevator

 block/bfq-cgroup.c   |   4 +-
 block/bfq-iosched.c  |  53 ++++------
 block/bfq-iosched.h  |   2 +-
 block/blk-mq-sched.c | 226 +++++++++++++++++++++++++++++--------------
 block/blk-mq.c       |   5 +-
 block/blk-mq.h       |  21 ++++
 block/elevator.c     |   1 +
 block/elevator.h     |  61 +++++++++++-
 block/mq-deadline.c  |  58 +++++------
 9 files changed, 282 insertions(+), 149 deletions(-)

-- 
2.39.2


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

end of thread, other threads:[~2025-06-16  9:15 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-14  9:25 [PATCH RFC v2 0/5] blk-mq-sched: support request batch dispatching for sq elevator Yu Kuai
2025-06-14  9:25 ` [PATCH RFC v2 1/5] elevator: introduce global lock for sq_shared elevator Yu Kuai
2025-06-16  2:38   ` Damien Le Moal
2025-06-14  9:25 ` [PATCH RFC v2 2/5] mq-deadline: switch to use elevator lock Yu Kuai
2025-06-16  2:41   ` Damien Le Moal
2025-06-14  9:25 ` [PATCH RFC v2 3/5] block, bfq: " Yu Kuai
2025-06-16  2:46   ` Damien Le Moal
2025-06-14  9:25 ` [PATCH RFC v2 4/5] blk-mq-sched: refactor __blk_mq_do_dispatch_sched() Yu Kuai
2025-06-16  2:54   ` Damien Le Moal
2025-06-14  9:25 ` [PATCH RFC v2 5/5] blk-mq-sched: support request batch dispatching for sq elevator Yu Kuai
2025-06-16  3:07   ` Damien Le Moal
2025-06-16  4:03 ` [PATCH RFC v2 0/5] " Damien Le Moal
2025-06-16  7:22   ` Yu Kuai
2025-06-16  7:37     ` Damien Le Moal
2025-06-16  9:14       ` Yu Kuai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).