Commit 1d6d088
Xiaoguang Wang
io_uring: avoid whole io_wq_work copy for requests completed inline
to #28736503
commit 7cdaf58 upstream
If requests can be submitted and completed inline, we don't need to
initialize whole io_wq_work in io_init_req(), which is an expensive
operation, add a new 'REQ_F_WORK_INITIALIZED' to determine whether
io_wq_work is initialized and add a helper io_req_init_async(), users
must call io_req_init_async() for the first time touching any members
of io_wq_work.
I use /dev/nullb0 to evaluate performance improvement in my physical
machine:
modprobe null_blk nr_devices=1 completion_nsec=0
sudo taskset -c 60 fio -name=fiotest -filename=/dev/nullb0 -iodepth=128
-thread -rw=read -ioengine=io_uring -direct=1 -bs=4k -size=100G -numjobs=1
-time_based -runtime=120
before this patch:
Run status group 0 (all jobs):
READ: bw=724MiB/s (759MB/s), 724MiB/s-724MiB/s (759MB/s-759MB/s),
io=84.8GiB (91.1GB), run=120001-120001msec
With this patch:
Run status group 0 (all jobs):
READ: bw=761MiB/s (798MB/s), 761MiB/s-761MiB/s (798MB/s-798MB/s),
io=89.2GiB (95.8GB), run=120001-120001msec
About 5% improvement.
Signed-off-by: Xiaoguang Wang <xiaoguang.wang@linux.alibaba.com>
Acked-by: Joseph Qi <joseph.qi@linux.alibaba.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Xiaoguang Wang <xiaoguang.wang@linux.alibaba.com>
Acked-by: Joseph Qi <joseph.qi@linux.alibaba.com>1 parent c081099 commit 1d6d088
2 files changed
+36
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | 96 | | |
102 | 97 | | |
103 | 98 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
532 | 532 | | |
533 | 533 | | |
534 | 534 | | |
| 535 | + | |
535 | 536 | | |
536 | 537 | | |
537 | 538 | | |
| |||
589 | 590 | | |
590 | 591 | | |
591 | 592 | | |
| 593 | + | |
| 594 | + | |
592 | 595 | | |
593 | 596 | | |
594 | 597 | | |
| |||
901 | 904 | | |
902 | 905 | | |
903 | 906 | | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
904 | 920 | | |
905 | 921 | | |
906 | 922 | | |
| |||
1030 | 1046 | | |
1031 | 1047 | | |
1032 | 1048 | | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
1033 | 1052 | | |
1034 | 1053 | | |
1035 | 1054 | | |
| |||
2776 | 2795 | | |
2777 | 2796 | | |
2778 | 2797 | | |
2779 | | - | |
| 2798 | + | |
| 2799 | + | |
| 2800 | + | |
| 2801 | + | |
| 2802 | + | |
| 2803 | + | |
2780 | 2804 | | |
| 2805 | + | |
2781 | 2806 | | |
2782 | 2807 | | |
2783 | 2808 | | |
| |||
3364 | 3389 | | |
3365 | 3390 | | |
3366 | 3391 | | |
3367 | | - | |
| 3392 | + | |
| 3393 | + | |
3368 | 3394 | | |
| 3395 | + | |
3369 | 3396 | | |
3370 | 3397 | | |
3371 | 3398 | | |
| |||
4770 | 4797 | | |
4771 | 4798 | | |
4772 | 4799 | | |
| 4800 | + | |
| 4801 | + | |
4773 | 4802 | | |
4774 | 4803 | | |
4775 | 4804 | | |
| |||
5424 | 5453 | | |
5425 | 5454 | | |
5426 | 5455 | | |
5427 | | - | |
| 5456 | + | |
| 5457 | + | |
5428 | 5458 | | |
5429 | 5459 | | |
5430 | 5460 | | |
| |||
5447 | 5477 | | |
5448 | 5478 | | |
5449 | 5479 | | |
| 5480 | + | |
| 5481 | + | |
5450 | 5482 | | |
5451 | 5483 | | |
5452 | 5484 | | |
| |||
5699 | 5731 | | |
5700 | 5732 | | |
5701 | 5733 | | |
5702 | | - | |
5703 | 5734 | | |
5704 | 5735 | | |
5705 | 5736 | | |
| |||
5721 | 5752 | | |
5722 | 5753 | | |
5723 | 5754 | | |
| 5755 | + | |
5724 | 5756 | | |
5725 | 5757 | | |
5726 | 5758 | | |
| |||
0 commit comments