agora inbox for pgsql-bugs@postgresql.org
help / color / mirror / Atom feedFrom: Pierre Forstmann <pierre.forstmann@gmail.com>
To: surya poondla <suryapoondla4@gmail.com>
Cc: Andres Freund <andres@anarazel.de>
Cc: Si, Evan <evsi@amazon.com>
Cc: pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>
Cc: Laurenz Albe <laurenz.albe@cybertec.at>
Subject: Re: BUG #19369: Not documented that io_uring on kernel versions between 5.1 and below 5.6 does not work
Date: Thu, 27 Aug 2026 17:49:50 +0200
Message-ID: <85f24359-47b8-4d62-9fe1-4c29e1767db3@gmail.com> (raw)
In-Reply-To: <CAOVWO5oVccTRo9RsJvjMCRuBppu_R5Azo+-dq0cQyhds5_4XXw@mail.gmail.com>
References: <19369-aa853da20e970a89@postgresql.org>
<CAOVWO5ozUNcLLB=sXdjqyd54SYL8W-u636XYHzpUROx-p8rtFA@mail.gmail.com>
<CAOVWO5qufByqYyUS87X80-T=XDdMTaBNjqc9LNrXcCqYc8A5rQ@mail.gmail.com>
<A0384D56-5A3B-404C-92D6-DB76AF1483E5@amazon.com>
<rjo26nijemix22gllbpknliioyndrcu2mg3ojdduy5tencve5w@5hmjportc75t>
<CAOVWO5p5z10mbsjyzWfv0m4gdGcAjtnat991qLWKYRJEc5sAew@mail.gmail.com>
<20ad6102-afed-4821-9136-d0b55b5a45f9@gmail.com>
<hg7mmunuylerqg2zeqvjufu5iatcq5unvuxany6lknrtxprr3v@6wa2mpid3oww>
<a7e0b62e1011b9a1161fe597f6822694988bd644.camel@cybertec.at>
<CAOVWO5ovWe76XqJozO7rbOGXWLx_2VMBC=dnArZb4T-o9B6OrA@mail.gmail.com>
<CAOVWO5q5hoQvLM_xY-yGDyn7kv-s8Dg7uTcTfqqqPHVjFYKJ1Q@mail.gmail.com>
<CAOVWO5omcWQxRVog5p+pNHtP3Z-RduZtnpP6i_Uqm-UrXD8LPQ@mail.gmail.com>
<CAOVWO5pfR0-183qw0GXJ6hTqWGEUVOgp3DX-aU=bhMRbRr9f+g@mail.gmail.com>
<CAOVWO5oVccTRo9RsJvjMCRuBppu_R5Azo+-dq0cQyhds5_4XXw@mail.gmail.com>
Hi Surya,
I confirm that the compiler warning is fixed in patch v4.
About testing with meson I use following commands:
# make check
meson test -C build --print-errorlogs --suite setup --suite regress
# make installcheck-world
meson test -C build -q --print-errorlogs --setup running
I have used Ubuntu 2004 to reproduce the issue with Linux kernel 5.4.
After applying the patch and setting io_method=io_uring ,I have checked
that PG cannot be restarted:
2026-08-27 14:54:13.787 UTC [98714] FATAL: kernel does not support
required io_uring operations
2026-08-27 14:54:13.787 UTC [98714] DETAIL: The kernel supports
io_uring but lacks one or more of the required opcodes (IORING_OP_READ,
IORING_OP_WRITE, IORING_OP_READV, IORING_OP_WRITEV). This typically
occurs on Linux kernels older than 5.6.
2026-08-27 14:54:13.787 UTC [98714] HINT: Either upgrade your kernel to
version 5.6 or newer, or use io_method=worker.
2026-08-27 14:54:13.788 UTC [98714] LOG: database system is shut down
I have checked this with building PG with make and with meson.
I have also reviewed the source code and I have question about following
code section:
#ifdef HAVE_IO_URING_OPCODE_SUPPORTED
/*
* Use io_uring_opcode_supported() if available (liburing 2.1+).
* This directly queries the kernel for opcode support.
*
* PostgreSQL uses both single-buffer (READ/WRITE) and vectored
* (READV/WRITEV) operations. READV/WRITEV were added in kernel
5.1,
* but READ/WRITE were added in kernel 5.6. Check for all four to
* ensure complete support.
*/
if (!io_uring_opcode_supported(&test_ring, IORING_OP_READ) ||
!io_uring_opcode_supported(&test_ring, IORING_OP_WRITE) ||
!io_uring_opcode_supported(&test_ring, IORING_OP_READV) ||
!io_uring_opcode_supported(&test_ring, IORING_OP_WRITEV))
{
unsupported = true;
}
#else
I have tried to compile the routine "is_uring_read_write_unsupported"
in a standalone executable and I get following errors:
taio.c: In function ‘is_uring_read_write_unsupported’:
taio.c:63:40: error: passing argument 1 of ‘io_uring_opcode_supported’
from incompatible pointer type [-Wincompatible-pointer-types]
63 | if (!io_uring_opcode_supported(&test_ring,
IORING_OP_READ) ||
| ^~~~~~~~~~
| |
| struct io_uring *
In file included from taio.c:16:
/usr/include/liburing.h:153:74: note: expected ‘const struct
io_uring_probe *’ but argument is of type ‘struct io_uring *’
153 | IOURINGINLINE int io_uring_opcode_supported(const struct
io_uring_probe *p,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
taio.c:64:44: error: passing argument 1 of ‘io_uring_opcode_supported’
from incompatible pointer type [-Wincompatible-pointer-types]
64 | !io_uring_opcode_supported(&test_ring, IORING_OP_WRITE) ||
| ^~~~~~~~~~
| |
| struct io_uring *
/usr/include/liburing.h:153:74: note: expected ‘const struct
io_uring_probe *’ but argument is of type ‘struct io_uring *’
153 | IOURINGINLINE int io_uring_opcode_supported(const struct
io_uring_probe *p,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
taio.c:65:44: error: passing argument 1 of ‘io_uring_opcode_supported’
from incompatible pointer type [-Wincompatible-pointer-types]
65 | !io_uring_opcode_supported(&test_ring, IORING_OP_READV) ||
| ^~~~~~~~~~
| |
| struct io_uring *
/usr/include/liburing.h:153:74: note: expected ‘const struct
io_uring_probe *’ but argument is of type ‘struct io_uring *’
153 | IOURINGINLINE int io_uring_opcode_supported(const struct
io_uring_probe *p,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
taio.c:66:44: error: passing argument 1 of ‘io_uring_opcode_supported’
from incompatible pointer type [-Wincompatible-pointer-types]
66 | !io_uring_opcode_supported(&test_ring, IORING_OP_WRITEV))
| ^~~~~~~~~~
| |
| struct io_uring *
/usr/include/liburing.h:153:74: note: expected ‘const struct
io_uring_probe *’ but argument is of type ‘struct io_uring *’
153 | IOURINGINLINE int io_uring_opcode_supported(const struct
io_uring_probe *p,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
I get these errors both with Debian 13 and Ubuntu 2004.
Can you double-check if this is the right way to call
io_uring_opcode_support and/or if there is an issue with make/meson
configuration ?
Regards,
PF
Le 27/08/2026 à 01:28, surya poondla a écrit :
> Hi Pierre,
>
> Thank you for the review.
>
> I fixed the compiler warning in v4.
>
> I also would like to know if you manage to run the equivalent of
> 'make installcheck-world" with meson ?
>
>
> I couldn't either. I noticed the "meson test --setup running" was
> running SQL suites (regress, isolation) only and not the TAP suite.
> So it does not look equivalent to installcheck-world in any case.
>
> I am doing some additional testing and will update my findings.
>
> Regards,
> Surya Poondla
view thread (18+ messages)
Message-ID: <85f24359-47b8-4d62-9fe1-4c29e1767db3@gmail.com>
Permalink: ../85f24359-47b8-4d62-9fe1-4c29e1767db3@gmail.com/
Also on: postgresql.org/message-id/85f24359-47b8-4d62-9fe1-4c29e1767db3@gmail.com
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-bugs@postgresql.org
Cc: pierre.forstmann@gmail.com, suryapoondla4@gmail.com, andres@anarazel.de, evsi@amazon.com, pgsql-bugs@lists.postgresql.org, laurenz.albe@cybertec.at
Subject: Re: BUG #19369: Not documented that io_uring on kernel versions between 5.1 and below 5.6 does not work
In-Reply-To: <85f24359-47b8-4d62-9fe1-4c29e1767db3@gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox