From: Damien Le Moal <dlemoal@kernel.org>
To: Yu Kuai <yukuai1@huaweicloud.com>,
ming.lei@redhat.com, yukuai3@huawei.com, tj@kernel.org,
josef@toxicpanda.com, axboe@kernel.dk
Cc: linux-block@vger.kernel.org, cgroups@vger.kernel.org,
linux-kernel@vger.kernel.org, yi.zhang@huawei.com,
yangerkun@huawei.com, johnny.chenyi@huawei.com
Subject: Re: [PATCH RFC v2 0/5] blk-mq-sched: support request batch dispatching for sq elevator
Date: Mon, 16 Jun 2025 13:03:59 +0900 [thread overview]
Message-ID: <9d3aee10-9eb3-4f2d-bb9a-1721c05ec3aa@kernel.org> (raw)
In-Reply-To: <20250614092528.2352680-1-yukuai1@huaweicloud.com>
On 6/14/25 18:25, Yu Kuai wrote:
> 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 |
For the HDD, these numbers are very low, and I do not understand how you can get
any improvement from reducing lock contention, since contention should not be an
issue with this kind of performance. What HW did you use for testing ? Was this
a VM ?
I tested this null_blk setup and your fio command on a bare-metal 16-cores Xeon
machine. For the scsi disk, I used a 26TB SATA HDD connected to an AHCI port).
With this setup, results are like this:
| | null_blk | hdd (write) | hdd (read) |
| --------------- | -------- | ----------- | ---------- |
| before this set | 613k | 1088 | 211 |
| after this set | 940k | 1093 | 212 |
So not surprisingly, there is no improvement for the SATA HDD because of the low
max IOPS these devices can achieve: lock contention is not really an issue when
you are dealing with a slow device. And a SAS HDD will be the same. Gains may
likely be more significant with a fast SAS/FC RAID array but I do not have
access to that.
But the improvement for a fast device like null_blk is indeed excellent (+53%).
With LOCKDEP & KASAN disabled, the results are like this:
| | null_blk | hdd (write) | hdd (read) |
| --------------- | -------- | ----------- | ---------- |
| before this set | 625k | 1092 | 213 |
| after this set | 984k | 1095 | 215 |
No real changes for the HDD, as expected, and the improvement for null_blk is
still good.
So maybe drop the RFC tag on these patches and repost after cleaning things up ?
--
Damien Le Moal
Western Digital Research
next prev parent reply other threads:[~2025-06-16 4:04 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
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 ` Damien Le Moal [this message]
2025-06-16 7:22 ` [PATCH RFC v2 0/5] " Yu Kuai
2025-06-16 7:37 ` Damien Le Moal
2025-06-16 9:14 ` Yu Kuai
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9d3aee10-9eb3-4f2d-bb9a-1721c05ec3aa@kernel.org \
--to=dlemoal@kernel.org \
--cc=axboe@kernel.dk \
--cc=cgroups@vger.kernel.org \
--cc=johnny.chenyi@huawei.com \
--cc=josef@toxicpanda.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ming.lei@redhat.com \
--cc=tj@kernel.org \
--cc=yangerkun@huawei.com \
--cc=yi.zhang@huawei.com \
--cc=yukuai1@huaweicloud.com \
--cc=yukuai3@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).