Io uring: Difference between revisions
No edit summary |
No edit summary |
||
Line 9: | Line 9: | ||
It works by creating two [[circular buffer]]s, called "queue rings", for storage of submission and completion of I/O requests, respectively. For storage devices, these are called the submission queue (SQ) and completion queue (CQ).<ref name=":1">{{Cite web|title=Getting Hands-on with io_uring using Go|url=https://developers.mattermost.com/blog/hands-on-iouring-go/|access-date=2021-11-20|website=developers.mattermost.com|language=en-us}}</ref> Keeping these buffers shared between the kernel and application helps to boost the [[IOPS|I/O performance]] by eliminating the need to issue extra and expensive system calls to copy these buffers between the two.<ref name="Axboe2019">{{Cite web|title=Linux Kernel Getting io_uring To Deliver Fast & Efficient I/O - Phoronix|url=https://www.phoronix.com/scan.php?page=news_item&px=Linux-io_uring-Fast-Efficient|url-status=live|access-date=2021-03-14|website=[[Phoronix]]}}</ref><ref name=":0">{{Cite web|title=The rapid growth of io_uring [LWN.net]|url=https://lwn.net/Articles/810414/|access-date=2021-11-20|website=lwn.net}}</ref><ref name=":1" /> According to the io_uring design paper, the SQ buffer is writable only by consumer applications, and the CQ buffer is writable only by the kernel.{{R|name=Axboe2019|page=3}} |
It works by creating two [[circular buffer]]s, called "queue rings", for storage of submission and completion of I/O requests, respectively. For storage devices, these are called the submission queue (SQ) and completion queue (CQ).<ref name=":1">{{Cite web|title=Getting Hands-on with io_uring using Go|url=https://developers.mattermost.com/blog/hands-on-iouring-go/|access-date=2021-11-20|website=developers.mattermost.com|language=en-us}}</ref> Keeping these buffers shared between the kernel and application helps to boost the [[IOPS|I/O performance]] by eliminating the need to issue extra and expensive system calls to copy these buffers between the two.<ref name="Axboe2019">{{Cite web|title=Linux Kernel Getting io_uring To Deliver Fast & Efficient I/O - Phoronix|url=https://www.phoronix.com/scan.php?page=news_item&px=Linux-io_uring-Fast-Efficient|url-status=live|access-date=2021-03-14|website=[[Phoronix]]}}</ref><ref name=":0">{{Cite web|title=The rapid growth of io_uring [LWN.net]|url=https://lwn.net/Articles/810414/|access-date=2021-11-20|website=lwn.net}}</ref><ref name=":1" /> According to the io_uring design paper, the SQ buffer is writable only by consumer applications, and the CQ buffer is writable only by the kernel.{{R|name=Axboe2019|page=3}} |
||
==History== |
|||
The API provided by the {{Code|liburing}} library for [[userspace]] can be used to interact with the kernel interface more easily.<ref name="Axboe2019" />{{R|name=Axboe2019|page=12}} The kernel interface and library were adopted in Linux kernel version 5.1.<ref name="Axboe2019" /><ref name=":0" /><ref>{{Cite web|title=Faster IO through io_uring {{!}} Kernel Recipes 2019|url=https://kernel-recipes.org/en/2019/talks/faster-io-through-io_uring/|access-date=2021-03-14|language=en-GB}}</ref> |
|||
The Linux kernel has had [[asynchronous I/O]] since version 2.5, but it was seen as difficult to use and inefficient.<ref>{{Cite web|last=Corbet|first=Jonathan|title=Ringing in a new asynchronous I/O API|url=https://lwn.net/Articles/776703/|url-status=live|access-date=2021-03-14|website=[[LWN.net]]}}</ref> The old API only supported certain niche [[use cases]].<ref>{{cite web | url = https://kernel.dk/axboe-kr2022.pdf | title = What’s new with io_uring | access-date = 2022-06-01}}</ref> |
The kernel interface and library were adopted in Linux kernel version 5.1.<ref name="Axboe2019" /><ref name=":0" /><ref>{{Cite web|title=Faster IO through io_uring {{!}} Kernel Recipes 2019|url=https://kernel-recipes.org/en/2019/talks/faster-io-through-io_uring/|access-date=2021-03-14|language=en-GB}}</ref> The API provided by the {{Code|liburing}} library for [[userspace]] can be used to interact with the kernel interface more easily.<ref name="Axboe2019" />{{R|name=Axboe2019|page=12}} The Linux kernel has had [[asynchronous I/O]] since version 2.5, but it was seen as difficult to use and inefficient.<ref>{{Cite web|last=Corbet|first=Jonathan|title=Ringing in a new asynchronous I/O API|url=https://lwn.net/Articles/776703/|url-status=live|access-date=2021-03-14|website=[[LWN.net]]}}</ref> The old API only supported certain niche [[use cases]].<ref>{{cite web | url = https://kernel.dk/axboe-kr2022.pdf | title = What’s new with io_uring | access-date = 2022-06-01}}</ref> |
||
== References == |
== References == |
Revision as of 08:51, 4 January 2023
io_uring (previously known as aioring) is a Linux kernel system call interface for storage device asynchronous I/O operations addressing performance issues with similar interfaces provided by functions like read()
/write()
or aio_read()
/aio_write()
etc. for operations on data accessed by file descriptors.[1][2]: 2
Development is ongoing, worked on primarily by Jens Axboe at Meta.[1]
Interface
It works by creating two circular buffers, called "queue rings", for storage of submission and completion of I/O requests, respectively. For storage devices, these are called the submission queue (SQ) and completion queue (CQ).[3] Keeping these buffers shared between the kernel and application helps to boost the I/O performance by eliminating the need to issue extra and expensive system calls to copy these buffers between the two.[1][4][3] According to the io_uring design paper, the SQ buffer is writable only by consumer applications, and the CQ buffer is writable only by the kernel.[1]: 3
History
The kernel interface and library were adopted in Linux kernel version 5.1.[1][4][5] The API provided by the liburing
library for userspace can be used to interact with the kernel interface more easily.[1][1]: 12 The Linux kernel has had asynchronous I/O since version 2.5, but it was seen as difficult to use and inefficient.[6] The old API only supported certain niche use cases.[7]
References
- ^ a b c d e f g "Linux Kernel Getting io_uring To Deliver Fast & Efficient I/O - Phoronix". Phoronix. Retrieved 2021-03-14.
{{cite web}}
: CS1 maint: url-status (link) - ^ Axboe, Jens (October 15, 2019). "Efficient IO with io_uring" (PDF).
{{cite web}}
: CS1 maint: url-status (link) - ^ a b "Getting Hands-on with io_uring using Go". developers.mattermost.com. Retrieved 2021-11-20.
- ^ a b "The rapid growth of io_uring [LWN.net]". lwn.net. Retrieved 2021-11-20.
- ^ "Faster IO through io_uring | Kernel Recipes 2019". Retrieved 2021-03-14.
- ^ Corbet, Jonathan. "Ringing in a new asynchronous I/O API". LWN.net. Retrieved 2021-03-14.
{{cite web}}
: CS1 maint: url-status (link) - ^ "What's new with io_uring" (PDF). Retrieved 2022-06-01.
External links
- Efficient I/O with io_uring, in-depth description of motivation behind io_uring, interface (data structures etc.), and performance assessment
liburing
source repositoryio_uring
source directory in the Linux kernel repository