Skip to content

blk-mq: introduce new queue attribute async_depth#536

Open
blktests-ci[bot] wants to merge 8 commits intolinus-master_basefrom
series/1050157=>linus-master
Open

blk-mq: introduce new queue attribute async_depth#536
blktests-ci[bot] wants to merge 8 commits intolinus-master_basefrom
series/1050157=>linus-master

Conversation

@blktests-ci
Copy link

@blktests-ci blktests-ci bot commented Feb 3, 2026

Pull request for series with
subject: blk-mq: introduce new queue attribute async_depth
version: 7
url: https://patchwork.kernel.org/project/linux-block/list/?series=1050157

@blktests-ci
Copy link
Author

blktests-ci bot commented Feb 3, 2026

Upstream branch: 8dfce89
series: https://patchwork.kernel.org/project/linux-block/list/?series=1050157
version: 7

@blktests-ci
Copy link
Author

blktests-ci bot commented Feb 3, 2026

Upstream branch: 8dfce89
series: https://patchwork.kernel.org/project/linux-block/list/?series=1050157
version: 7

@blktests-ci blktests-ci bot force-pushed the series/1050157=>linus-master branch from d98ba93 to 7444d08 Compare February 3, 2026 08:33
@blktests-ci blktests-ci bot force-pushed the linus-master_base branch from 483aa43 to 9d3c6de Compare February 3, 2026 19:06
@blktests-ci
Copy link
Author

blktests-ci bot commented Feb 3, 2026

Upstream branch: de0674d
series: https://patchwork.kernel.org/project/linux-block/list/?series=1050157
version: 7

@blktests-ci blktests-ci bot force-pushed the series/1050157=>linus-master branch from 7444d08 to f8498ae Compare February 3, 2026 19:09
@blktests-ci
Copy link
Author

blktests-ci bot commented Feb 4, 2026

Upstream branch: de0674d
series: https://patchwork.kernel.org/project/linux-block/list/?series=1050157
version: 7

@blktests-ci blktests-ci bot force-pushed the series/1050157=>linus-master branch from f8498ae to 918f60d Compare February 4, 2026 01:59
@blktests-ci
Copy link
Author

blktests-ci bot commented Feb 4, 2026

Upstream branch: de0674d
series: https://patchwork.kernel.org/project/linux-block/list/?series=1050157
version: 7

@blktests-ci blktests-ci bot force-pushed the series/1050157=>linus-master branch from 918f60d to 8f2e419 Compare February 4, 2026 02:10
@blktests-ci blktests-ci bot force-pushed the linus-master_base branch from 9d3c6de to 7c2ae0a Compare February 5, 2026 03:28
@blktests-ci
Copy link
Author

blktests-ci bot commented Feb 5, 2026

Upstream branch: f14faaf
series: https://patchwork.kernel.org/project/linux-block/list/?series=1050157
version: 7

@blktests-ci blktests-ci bot force-pushed the series/1050157=>linus-master branch from 8f2e419 to 667b016 Compare February 5, 2026 03:31
@blktests-ci blktests-ci bot force-pushed the linus-master_base branch from 7c2ae0a to 54294d6 Compare February 6, 2026 08:51
This value represents the number of requests for elevator tags, or drivers
tags if elevator is none. The max value for elevator tags is 2048, and
in drivers at most 16 bits is used for tag.

Signed-off-by: Yu Kuai <yukuai@fnnas.com>
Reviewed-by: Nilay Shroff <nilay@linux.ibm.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
bfq and mq-deadline consider sync writes as async requests and only
reserve tags for sync reads by async_depth, however, kyber doesn't
consider sync writes as async requests for now.

Consider the case there are lots of dirty pages, and user use fsync to
flush dirty pages. In this case sched_tags can be exhausted by sync writes
and sync reads can stuck waiting for tag. Hence let kyber follow what
mq-deadline and bfq did, and unify async requests checking for all
elevators.

Signed-off-by: Yu Kuai <yukuai@fnnas.com>
Reviewed-by: Nilay Shroff <nilay@linux.ibm.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
There are no functional changes, just make code cleaner.

Signed-off-by: Yu Kuai <yukuai@fnnas.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Add a new field async_depth to request_queue and related APIs, this is
currently not used, following patches will convert elevators to use
this instead of internal async_depth.

Signed-off-by: Yu Kuai <yukuai@fnnas.com>
Reviewed-by: Nilay Shroff <nilay@linux.ibm.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Instead of the internal async_depth, remove kqd->async_depth and related
helpers.

Noted elevator attribute async_depth is now removed, queue attribute
with the same name is used instead.

Signed-off-by: Yu Kuai <yukuai@fnnas.com>
Reviewed-by: Nilay Shroff <nilay@linux.ibm.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
In downstream kernel, we test with mq-deadline with many fio workloads, and
we found a performance regression after commit 39823b4
("block/mq-deadline: Fix the tag reservation code") with following test:

[global]
rw=randread
direct=1
ramp_time=1
ioengine=libaio
iodepth=1024
numjobs=24
bs=1024k
group_reporting=1
runtime=60

[job1]
filename=/dev/sda

Root cause is that mq-deadline now support configuring async_depth,
although the default value is nr_request, however the minimal value is
1, hence min_shallow_depth is set to 1, causing wake_batch to be 1. For
consequence, sbitmap_queue will be waken up after each IO instead of
8 IO.

In this test case, sda is HDD and max_sectors is 128k, hence each
submitted 1M io will be splited into 8 sequential 128k requests, however
due to there are 24 jobs and total tags are exhausted, the 8 requests are
unlikely to be dispatched sequentially, and changing wake_batch to 1
will make this much worse, accounting blktrace D stage, the percentage
of sequential io is decreased from 8% to 0.8%.

Fix this problem by converting to request_queue->async_depth, where
min_shallow_depth is set each time async_depth is updated.

Noted elevator attribute async_depth is now removed, queue attribute
with the same name is used instead.

Fixes: 39823b4 ("block/mq-deadline: Fix the tag reservation code")
Signed-off-by: Yu Kuai <yukuai@fnnas.com>
Reviewed-by: Nilay Shroff <nilay@linux.ibm.com>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: Hannes Reinecke <hare@suse.de>
The default limits is unchanged, and user can configure async_depth now.

Signed-off-by: Yu Kuai <yukuai@fnnas.com>
Reviewed-by: Nilay Shroff <nilay@linux.ibm.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Explain the attribute and the default value in different case.

Signed-off-by: Yu Kuai <yukuai@fnnas.com>
Reviewed-by: Nilay Shroff <nilay@linux.ibm.com>
@blktests-ci
Copy link
Author

blktests-ci bot commented Feb 6, 2026

Upstream branch: b7ff715
series: https://patchwork.kernel.org/project/linux-block/list/?series=1050157
version: 7

@blktests-ci blktests-ci bot force-pushed the series/1050157=>linus-master branch from 667b016 to 86ae750 Compare February 6, 2026 08:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant