blk-mq: introduce new queue attribute async_depth#536
blk-mq: introduce new queue attribute async_depth#536blktests-ci[bot] wants to merge 9 commits intolinus-master_basefrom
Conversation
|
Upstream branch: 8dfce89 |
|
Upstream branch: 8dfce89 |
d98ba93 to
7444d08
Compare
483aa43 to
9d3c6de
Compare
|
Upstream branch: de0674d |
7444d08 to
f8498ae
Compare
|
Upstream branch: de0674d |
f8498ae to
918f60d
Compare
|
Upstream branch: de0674d |
918f60d to
8f2e419
Compare
9d3c6de to
7c2ae0a
Compare
|
Upstream branch: f14faaf |
8f2e419 to
667b016
Compare
7c2ae0a to
54294d6
Compare
|
Upstream branch: b7ff715 |
667b016 to
86ae750
Compare
54294d6 to
eb49f7b
Compare
|
Upstream branch: e7aa572 |
86ae750 to
381329e
Compare
eb49f7b to
30e5c22
Compare
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]>
|
Upstream branch: 05f7e89 |
381329e to
d967bc6
Compare
30e5c22 to
519f160
Compare
|
Upstream branch: c22e26b Pull request is NOT updated. Failed to apply https://patchwork.kernel.org/project/linux-block/list/?series=1050157 conflict: |
e1fefe2 to
f714aad
Compare
f714aad to
df85678
Compare
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