Commit 988bb1b
mq-deadline: covert to use request_queue->async_depth
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>
Signed-off-by: Jens Axboe <axboe@kernel.dk>1 parent 8cbe62f commit 988bb1b
1 file changed
Lines changed: 5 additions & 34 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
101 | | - | |
102 | 101 | | |
103 | 102 | | |
104 | 103 | | |
| |||
486 | 485 | | |
487 | 486 | | |
488 | 487 | | |
489 | | - | |
490 | | - | |
491 | | - | |
492 | | - | |
493 | 488 | | |
494 | 489 | | |
495 | | - | |
496 | | - | |
497 | | - | |
498 | | - | |
499 | | - | |
500 | | - | |
501 | | - | |
502 | | - | |
503 | | - | |
504 | | - | |
505 | | - | |
| 490 | + | |
| 491 | + | |
506 | 492 | | |
507 | 493 | | |
508 | | - | |
| 494 | + | |
509 | 495 | | |
510 | 496 | | |
511 | | - | |
512 | | - | |
513 | | - | |
514 | | - | |
| 497 | + | |
515 | 498 | | |
516 | 499 | | |
517 | 500 | | |
| |||
576 | 559 | | |
577 | 560 | | |
578 | 561 | | |
| 562 | + | |
579 | 563 | | |
580 | 564 | | |
581 | 565 | | |
| |||
763 | 747 | | |
764 | 748 | | |
765 | 749 | | |
766 | | - | |
767 | 750 | | |
768 | 751 | | |
769 | 752 | | |
| |||
793 | 776 | | |
794 | 777 | | |
795 | 778 | | |
796 | | - | |
797 | 779 | | |
798 | 780 | | |
799 | 781 | | |
| |||
807 | 789 | | |
808 | 790 | | |
809 | 791 | | |
810 | | - | |
811 | 792 | | |
812 | 793 | | |
813 | 794 | | |
| |||
894 | 875 | | |
895 | 876 | | |
896 | 877 | | |
897 | | - | |
898 | | - | |
899 | | - | |
900 | | - | |
901 | | - | |
902 | | - | |
903 | | - | |
904 | | - | |
905 | | - | |
906 | 878 | | |
907 | 879 | | |
908 | 880 | | |
| |||
1002 | 974 | | |
1003 | 975 | | |
1004 | 976 | | |
1005 | | - | |
1006 | 977 | | |
1007 | 978 | | |
1008 | 979 | | |
| |||
0 commit comments