Re: [PATCH] check kernel version for io_method

From: Jakub Wartak <jakub(dot)wartak(at)enterprisedb(dot)com>
To: Steven Niu <niushiji(at)gmail(dot)com>
Cc: Andreas Karlsson <andreas(at)proxel(dot)se>, Pierre <pierre(dot)forstmann(at)gmail(dot)com>, "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: [PATCH] check kernel version for io_method
Date: 2026-01-14 11:14:35
Message-ID: CAKZiRmy3xrsju81b-fzUjtwn_dHR-744eJ31KYzo8hiyGnxMBA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Jan 14, 2026 at 3:31 AM Steven Niu <niushiji(at)gmail(dot)com> wrote:
>
> From: Andreas Karlsson <andreas(at)proxel(dot)se>
> Sent: Wednesday, January 14, 2026 09:07
> To: Pierre <pierre(dot)forstmann(at)gmail(dot)com>; pgsql-hackers(at)lists(dot)postgresql(dot)org <pgsql-hackers(at)lists(dot)postgresql(dot)org>
> 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2026-01-14 11:20:53 Re: [BUG] [PATCH] Allow physical replication slots to recover from archive after invalidation
Previous Message Jakub Wartak 2026-01-14 11:02:11 Re: pg_plan_advice