aio: io_uring: Allow IO methods to check if IO completed in the background
Andres Freund <andres@anarazel.de>
aio: io_uring: Allow IO methods to check if IO completed in the background Until now pgaio_wref_check_done() with io_method=io_uring would not detect if IOs are known to have completed to the kernel, but the completion has not yet been consumed by userspace. This can lead to inferior performance and also makes it harder to use smarter feedback logic in read_stream, because we cannot use knowledge about whether an IO completed to control the readahead distance. This commit just adds the io_uring specific infrastructure. Later commits will return whether a wait was needed from WaitReadBuffers() and then use that knowledge. Reviewed-by: Melanie Plageman <melanieplageman@gmail.com> Reviewed-by: Nazir Bilal Yavuz <byavuz81@gmail.com> Discussion: https://postgr.es/m/f3xxfrkafjxpyqxywcxricxgyizjirfceychyxsgn7bwjp5eda@kwbduhy7tfmu Discussion: https://postgr.es/m/CAH2-Wz%3DkMg3PNay96cHMT0LFwtxP-cQSRZTZzh1Cixxf8G%3Dzrw%40mail.gmail.com
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/storage/aio/aio.c | modified | +15 −5 |
| src/backend/storage/aio/method_io_uring.c | modified | +43 −0 |
| src/include/storage/aio_internal.h | modified | +15 −0 |
Discussion
- AIO / read stream heuristics adjustments for index prefetching 23 messages · 2026-03-31 → 2026-04-05
- index prefetching 492 messages · 2023-06-08 → 2026-07-07