aio: Add io_method=io_uring
Andres Freund <andres@anarazel.de>
aio: Add io_method=io_uring Performing AIO using io_uring can be considerably faster than io_method=worker, particularly when lots of small IOs are issued, as a) the context-switch overhead for worker based AIO becomes more significant b) the number of IO workers can become limiting io_uring, however, is linux specific and requires an additional compile-time dependency (liburing). This implementation is fairly simple and there are substantial optimization opportunities. The description of the existing AIO_IO_COMPLETION wait event is updated to make the difference between it and the new AIO_IO_URING_EXECUTION clearer. Reviewed-by: Noah Misch <noah@leadboat.com> Reviewed-by: Jakub Wartak <jakub.wartak@enterprisedb.com> Discussion: https://postgr.es/m/uvrtrknj4kdytuboidbhwclo4gxhswwcpgadptsjvjqcluzmah%40brqs62irg4dt Discussion: https://postgr.es/m/20210223100344.llw5an2aklengrmn@alap3.anarazel.de Discussion: https://postgr.es/m/stj36ea6yyhoxtqkhpieia2z4krnam7qyetc57rfezgk4zgapf@gcnactj4z56m
Files
| Path | Change | +/− |
|---|---|---|
| .cirrus.tasks.yml | modified | +3 −0 |
| doc/src/sgml/config.sgml | modified | +8 −0 |
| src/backend/storage/aio/aio.c | modified | +41 −0 |
| src/backend/storage/aio/aio_io.c | modified | +22 −0 |
| src/backend/storage/aio/Makefile | modified | +1 −0 |
| src/backend/storage/aio/meson.build | modified | +1 −0 |
| src/backend/storage/aio/method_io_uring.c | added | +484 −0 |
| src/backend/storage/lmgr/lwlock.c | modified | +1 −0 |
| src/backend/utils/activity/wait_event_names.txt | modified | +3 −1 |
| src/backend/utils/misc/postgresql.conf.sample | modified | +2 −1 |
| src/include/storage/aio.h | modified | +8 −0 |
| src/include/storage/aio_internal.h | modified | +13 −0 |
| src/include/storage/lwlock.h | modified | +1 −0 |
| src/tools/pgindent/typedefs.list | modified | +1 −0 |
Documentation touched
Discussion
- Asynchronous and "direct" IO support for PostgreSQL. 28 messages · 2021-02-23 → 2023-01-17
- AIO writes vs hint bits vs checksums 24 messages · 2024-09-24 → 2025-10-28
- AIO v2.0 213 messages · 2024-09-01 → 2025-07-29