pgsql: aio: io_uring: Allow IO methods to check if IO completed in the

From: Andres Freund <andres(at)anarazel(dot)de>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: aio: io_uring: Allow IO methods to check if IO completed in the
Date: 2026-04-01 13:27:15
Message-ID: E1w7vbG-002SpH-1Z@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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(at)gmail(dot)com>
Reviewed-by: Nazir Bilal Yavuz <byavuz81(at)gmail(dot)com>
Discussion: https://postgr.es/m/f3xxfrkafjxpyqxywcxricxgyizjirfceychyxsgn7bwjp5eda@kwbduhy7tfmu
Discussion: https://postgr.es/m/CAH2-Wz%3DkMg3PNay96cHMT0LFwtxP-cQSRZTZzh1Cixxf8G%3Dzrw%40mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/6e648e353fa04ad86f896da347bbb9b51bc98ad4

Modified Files
--------------
src/backend/storage/aio/aio.c | 20 ++++++++++----
src/backend/storage/aio/method_io_uring.c | 43 +++++++++++++++++++++++++++++++
src/include/storage/aio_internal.h | 15 +++++++++++
3 files changed, 73 insertions(+), 5 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Nathan Bossart 2026-04-01 14:49:46 pgsql: doc: Add missing description for DROP SUBSCRIPTION IF EXISTS.
Previous Message Amit Langote 2026-04-01 09:48:04 pgsql: Make FastPathMeta self-contained by copying FmgrInfo structs