public inbox for [email protected]help / color / mirror / Atom feed
Re: BUG #19369: Not documented that io_uring on kernel versions between 5.1 and below 5.6 does not work 4+ messages / 3 participants [nested] [flat]
* Re: BUG #19369: Not documented that io_uring on kernel versions between 5.1 and below 5.6 does not work @ 2026-01-13 19:06 surya poondla <[email protected]> 0 siblings, 2 replies; 4+ messages in thread From: surya poondla @ 2026-01-13 19:06 UTC (permalink / raw) To: Andres Freund <[email protected]>; +Cc: Si, Evan <[email protected]>; [email protected] <[email protected]> Hi Evan, Andres, Here is the patch (attached). I believe this change would also be a good candidate for backpatching to previous supported versions. Regards, Surya Poondla Attachments: [application/octet-stream] 0001-Document-correct-kernel-requirements-for-io_uring.patch (2.3K, 3-0001-Document-correct-kernel-requirements-for-io_uring.patch) download | inline diff: From 497eb813c0c41d870e3659c29876d42e750f666c Mon Sep 17 00:00:00 2001 From: spoondla <[email protected]> Date: Mon, 12 Jan 2026 15:29:48 -0800 Subject: [PATCH] Document correct kernel requirements for io_uring While io_uring was introduced in Linux 5.1, PostgreSQL requires kernel version 5.6 or newer due to the io_uring operations it relies on. Earlier kernels may appear to support io_uring but can fail at runtime. Updated the internal AIO documentation and the sample configuration file to state the correct minimum kernel requirement. --- src/backend/storage/aio/README.md | 8 +++++++- src/backend/utils/misc/postgresql.conf.sample | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/backend/storage/aio/README.md b/src/backend/storage/aio/README.md index 72ae3b3737d..c40a6ce16cf 100644 --- a/src/backend/storage/aio/README.md +++ b/src/backend/storage/aio/README.md @@ -256,10 +256,16 @@ synchronous manner. #### io_uring -`io_method=io_uring` is available on Linux 5.1+. In contrast to worker mode it +`io_method=io_uring` is available on Linux 5.6+. In contrast to worker mode it dispatches all IO from within the process, lowering context switch rate / latency. +While io_uring was introduced in Linux kernel 5.1, the operations required by +PostgreSQL (IORING_OP_READ and IORING_OP_WRITE opcodes for non-vectored I/O) +are only available starting with Linux kernel 5.6. Attempting to use io_uring +on kernels between 5.1 and 5.5 will result in runtime errors (EINVAL) when +connections are established. + ### AIO Handles diff --git a/src/backend/utils/misc/postgresql.conf.sample b/src/backend/utils/misc/postgresql.conf.sample index dc9e2255f8a..1648f4be207 100644 --- a/src/backend/utils/misc/postgresql.conf.sample +++ b/src/backend/utils/misc/postgresql.conf.sample @@ -204,7 +204,7 @@ # (change requires restart) #io_combine_limit = 128kB # usually 1-128 blocks (depends on OS) -#io_method = worker # worker, io_uring, sync +#io_method = worker # worker, io_uring (Linux 5.6+), sync # (change requires restart) #io_max_concurrency = -1 # Max number of IOs that one process # can execute simultaneously -- 2.39.5 (Apple Git-154) ^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: BUG #19369: Not documented that io_uring on kernel versions between 5.1 and below 5.6 does not work @ 2026-01-13 19:11 Andres Freund <[email protected]> parent: surya poondla <[email protected]> 1 sibling, 0 replies; 4+ messages in thread From: Andres Freund @ 2026-01-13 19:11 UTC (permalink / raw) To: surya poondla <[email protected]>; +Cc: Si, Evan <[email protected]>; [email protected] <[email protected]> Hi, On 2026-01-13 11:06:20 -0800, surya poondla wrote: > Hi Evan, Andres, > > Here is the patch (attached). I think we ought to not just document the difference, but also emit a useful error message at startup... > I believe this change would also be a good candidate for backpatching to > previous supported versions. Yes, once we have something mergeable, it should definitely be added to 18 too. Greetings, Andres Freund ^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: BUG #19369: Not documented that io_uring on kernel versions between 5.1 and below 5.6 does not work @ 2026-01-14 18:15 Pierre Forstmann <[email protected]> parent: surya poondla <[email protected]> 1 sibling, 1 reply; 4+ messages in thread From: Pierre Forstmann @ 2026-01-14 18:15 UTC (permalink / raw) To: surya poondla <[email protected]>; Andres Freund <[email protected]>; +Cc: Si, Evan <[email protected]>; [email protected] <[email protected]> Hello, Is asynchronous I/O as introduced in PG 18 also available for Windows platform and possibly for Solaris, AIX, FreeBSD platforms ? If not maybe we should also mention in Server Configuration section that asynchronous I/O configuration is only available on Linux platforms. Is there any other feature only available for specific platforms ? I have not found a documentation section mentioning such cases (except for installations https://www.postgresql.org/docs/18/installation-platform-notes.html). PF Le 13/01/2026 à 20:06, surya poondla a écrit : > > Hi Evan, Andres, > > Here is the patch (attached). > > I believe this change would also be a good candidate for backpatching > to previous supported versions. > > Regards, Surya Poondla > ^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: BUG #19369: Not documented that io_uring on kernel versions between 5.1 and below 5.6 does not work @ 2026-01-14 18:18 Andres Freund <[email protected]> parent: Pierre Forstmann <[email protected]> 0 siblings, 0 replies; 4+ messages in thread From: Andres Freund @ 2026-01-14 18:18 UTC (permalink / raw) To: Pierre Forstmann <[email protected]>; +Cc: surya poondla <[email protected]>; Si, Evan <[email protected]>; [email protected] <[email protected]> Hi, On 2026-01-14 19:15:17 +0100, Pierre Forstmann wrote: > Is asynchronous I/O as introduced in PG 18 also available for Windows > platform and possibly for Solaris, AIX, FreeBSD platforms ? Yes, but only using io_method=worker. Greetings, Andres Freund ^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2026-01-14 18:18 UTC | newest] Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2026-01-13 19:06 Re: BUG #19369: Not documented that io_uring on kernel versions between 5.1 and below 5.6 does not work surya poondla <[email protected]> 2026-01-13 19:11 ` Andres Freund <[email protected]> 2026-01-14 18:15 ` Pierre Forstmann <[email protected]> 2026-01-14 18:18 ` Andres Freund <[email protected]>
This inbox is served by agora; see mirroring instructions for how to clone and mirror all data and code used for this inbox