Subject: Re: [PATCH] check kernel version for io_method

From: Jakub Wartak <[email-masked]>
Date: Wed, 14 Jan 2026 12:14:35 +0100

On Wed, Jan 14, 2026 at 3:31 AM Steven Niu <[email-masked]> wrote:
>
> From: Andreas Karlsson <[email-masked]>
> Sent: Wednesday, January 14, 2026 09:07
> To: Pierre <[email-masked]>; [email-masked] <[email-masked]>
> Subject: Re: [PATCH] check kernel version for io_method
>
>
> On 1/13/26 11:05 PM, Pierre wrote:
> > Please find a patch proposal for bug BUG #19369: Not documented that
> > io_uring on kernel versions between 5.1 and below 5.6 does not work.
> Wouldn't it make more sense to use io_uring_get_probe_ring() and
> io_uring_opcode_supported() to actually check for the required opcode?
> Then if someone uses a Kernel with the required features backported
> everything will still work.
>
> Andreas
>
> +1
> It would be more reliable to check the availability of io_uring feature than to check OS version.
>

Hi,

I haven't looked at this patch, however the above statement is not
completely true. There is a parallel problem [1] related to kernel
version, where if you do not run proper kernel version (>= 6.5) or
proper liburing version, then fork() (-> all connections established)
are going to be slow slugging under more than basic load due to lack
of "combined memory mapping creation" (so technically speaking
recommending someone to go to 5.6.x but < 6.5 IMHO is also not good
advice). See first message in that [1] for a performance report about
this. IMHVO if we are checking for kernel versions we could also warn
about performance regression (something like merge those two patches
if one wants to have a good io_uring experience).

-J.

[1] - https://www.postgresql.org/message-id/CAKZiRmzxj6Lt1w2ffDoUmN533TgyDeYVULEH1PQFLRyBJSFP6w%40mail.gmail.com

---

From: Andreas Karlsson <[email-masked]>
Date: Wed, 14 Jan 2026 18:26:27 +0100

> if one wants to have a good io_uring experience).

We can probe for that too, which we already do. If you call 
pgaio_uring_ring_shmem_size() it will return 0 on Linux <6.5. Which I 
think eve further supports probing for the features we need rather than 
looking at the kernel version.

Andreas