pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andres Freund <andres@anarazel.de>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: aio: io_uring: Allow IO methods to check if IO completed in the
Date: Wed, 01 Apr 2026 13:27:15 +0000
Message-ID: <E1w7vbG-002SpH-1Z@gemulon.postgresql.org> (raw)

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

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(-)



Message-ID: <E1w7vbG-002SpH-1Z@gemulon.postgresql.org>
Permalink:  ../E1w7vbG-002SpH-1Z@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1w7vbG-002SpH-1Z@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: andres@anarazel.de, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: aio: io_uring: Allow IO methods to check if IO completed in the
  In-Reply-To: <E1w7vbG-002SpH-1Z@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox