[MDEV-24883] add io_uring support for tpool Created: 2021-02-16 Updated: 2023-06-26 Resolved: 2021-03-15 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - InnoDB |
| Fix Version/s: | 10.6.0 |
| Type: | Task | Priority: | Major |
| Reporter: | Eugene Kosov (Inactive) | Assignee: | Eugene Kosov (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||||
| Description |
|
io_uring is fast and convenient. In contrast, Linux AIO has flaws: https://blog.cloudflare.com/io_submit-the-epoll-alternative-youve-never-heard-about/ liburing is a user space library which protects from writing a boiler plate code. https://github.com/axboe/liburing Let's use it. |
| Comments |
| Comment by Marko Mäkelä [ 2021-02-19 ] | |||||||||||||||||||||||||
|
Thank you. I tested this using an artificially small redo log, to get a On a SATA 3.0 HDD, the difference was more random and liburing could have been slightly slower at times. My 2-minute benchmark runs were probably simply too short to filter out randomness by averaging over a longer period of time. I can imagine that on rotational storage media, the performance depends on which sectors happen to be under the read/write head at the time of the request, in both dimensions (the spindle is rotating and the head is moving). | |||||||||||||||||||||||||
| Comment by Otto Kekäläinen [ 2021-03-09 ] | |||||||||||||||||||||||||
|
I can see that `liburing-dev` is available in Debian unstable (and soon to be released Debian 11) and in Ubuntu since Groovy (20.10): https://tracker.debian.org/pkg/liburing I see kevg assigned this issue to me last month but without any comments. What do you expect I should help out with here? | |||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2021-03-10 ] | |||||||||||||||||||||||||
|
otto, I see that you helped with PR#1773. If you do not expect any problems with adding the dependency in our packaging, I think that you can mark the review done and assign this back to kevg. | |||||||||||||||||||||||||
| Comment by Otto Kekäläinen [ 2021-03-10 ] | |||||||||||||||||||||||||
|
Related PR: https://github.com/MariaDB/server/pull/1773 But it seems the build does not obey `-DIGNORE_AIO_CHECK=YES` not use uring yet. So I can test this only once there is some actual uring support in 10.6 code base. | |||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2021-03-12 ] | |||||||||||||||||||||||||
|
I think that there are 2 things that must be fixed before this is completed: Startup fails with ENOMEM followed by SIGSEGV. This is repeatable if you set ulimit -l 0 before starting the server:
Shutdown (after a successful startup) fails with SIGABRT:
Finally, the systemd configuration must set LimitMEMLOCK to 503282 or some smaller value that is determined to be sufficient, so that we will not have to fall back to simulated AIO. I think that the proper place to handle it is support-files/CMakeLists.txt. | |||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2021-03-18 ] | |||||||||||||||||||||||||
|
I pushed a follow-up adjustment that allows ./mtr --rr to work out of the box until io_uring() system call emulation has been implemented in rr. Note: the older system call io_setup() always returned an error under rr. |