Skip to content

blk-mq: introduce new queue attribute async_depth#536

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

blk-mq: introduce new queue attribute async_depth#536
blktests-ci[bot] wants to merge 9 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
@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
@blktests-ci blktests-ci bot force-pushed the linus-master_base branch from 54294d6 to eb49f7b Compare February 8, 2026 02:55
@blktests-ci
Copy link
Author

blktests-ci bot commented Feb 8, 2026

Upstream branch: e7aa572
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 86ae750 to 381329e Compare February 8, 2026 04:16
@blktests-ci blktests-ci bot force-pushed the linus-master_base branch from eb49f7b to 30e5c22 Compare February 9, 2026 04:29
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 <[email protected]>
Reviewed-by: Nilay Shroff <[email protected]>
Reviewed-by: Hannes Reinecke <[email protected]>
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 <[email protected]>
Reviewed-by: Nilay Shroff <[email protected]>
Reviewed-by: Hannes Reinecke <[email protected]>
There are no functional changes, just make code cleaner.

Signed-off-by: Yu Kuai <[email protected]>
Reviewed-by: Hannes Reinecke <[email protected]>
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 <[email protected]>
Reviewed-by: Nilay Shroff <[email protected]>
Reviewed-by: Hannes Reinecke <[email protected]>
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 <[email protected]>
Reviewed-by: Nilay Shroff <[email protected]>
Reviewed-by: Hannes Reinecke <[email protected]>
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 <[email protected]>
Reviewed-by: Nilay Shroff <[email protected]>
Reviewed-by: Bart Van Assche <[email protected]>
Reviewed-by: Hannes Reinecke <[email protected]>
The default limits is unchanged, and user can configure async_depth now.

Signed-off-by: Yu Kuai <[email protected]>
Reviewed-by: Nilay Shroff <[email protected]>
Reviewed-by: Hannes Reinecke <[email protected]>
Explain the attribute and the default value in different case.

Signed-off-by: Yu Kuai <[email protected]>
Reviewed-by: Nilay Shroff <[email protected]>
@blktests-ci
Copy link
Author

blktests-ci bot commented Feb 9, 2026

Upstream branch: 05f7e89
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 381329e to d967bc6 Compare February 9, 2026 04:32
@blktests-ci blktests-ci bot force-pushed the linus-master_base branch from 30e5c22 to 519f160 Compare February 12, 2026 00:34
@blktests-ci
Copy link
Author

blktests-ci bot commented Feb 12, 2026

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

Pull request is NOT updated. Failed to apply https://patchwork.kernel.org/project/linux-block/list/?series=1050157
error message:

Cmd('git') failed due to: exit code(128)
  cmdline: git am --3way
  stdout: 'Applying: block: convert nr_requests to unsigned int
Using index info to reconstruct a base tree...
M	include/linux/blkdev.h
Falling back to patching base and 3-way merge...
Auto-merging include/linux/blkdev.h
CONFLICT (content): Merge conflict in include/linux/blkdev.h
Patch failed at 0001 block: convert nr_requests to unsigned int'
  stderr: 'error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config set advice.mergeConflict false"'

conflict:

diff --cc include/linux/blkdev.h
index 99ef8cd7673c,67d8d9e03abc..000000000000
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@@ -551,7 -551,6 +551,10 @@@ struct request_queue 
  	 * queue settings
  	 */
  	unsigned int		nr_requests;	/* Max # of requests */
++<<<<<<< HEAD
 +	unsigned int		async_depth;	/* Max # of async requests */
++=======
++>>>>>>> block: convert nr_requests to unsigned int
  
  #ifdef CONFIG_BLK_INLINE_ENCRYPTION
  	struct blk_crypto_profile *crypto_profile;

@blktests-ci blktests-ci bot force-pushed the linus-master_base branch 9 times, most recently from e1fefe2 to f714aad Compare February 18, 2026 05:50
@blktests-ci blktests-ci bot force-pushed the linus-master_base branch from f714aad to df85678 Compare February 19, 2026 12:49
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.

2 participants

Comments