Re: [PATCH] check kernel version for io_method - Mailing list pgsql-hackers

From Steven Niu
Subject Re: [PATCH] check kernel version for io_method
Date
Msg-id MN2PR15MB30219C300249CA008F144614A78FA@MN2PR15MB3021.namprd15.prod.outlook.com
Whole thread Raw
In response to Re: [PATCH] check kernel version for io_method  (Andreas Karlsson <andreas@proxel.se>)
Responses Re: [PATCH] check kernel version for io_method
List pgsql-hackers
From: Andreas Karlsson <andreas@proxel.se>
Sent: Wednesday, January 14, 2026 09:07
To: Pierre <pierre.forstmann@gmail.com>; pgsql-hackers@lists.postgresql.org <pgsql-hackers@lists.postgresql.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.

BTW, the error message in the following code block is wrong as it locates in branch that IO_URING is not enabled.

#else
+    if (*newval == IOMETHOD_WORKER || *newval == IOMETHOD_SYNC)
+    {
+        /*
+         * OK
+         */
+    }
+    else
+    {
+        GUC_check_errdetail("io_uring requires Linux kernel 5.6 or later.");
+        return false;
+    }



Thanks,
Steven


pgsql-hackers by date:

Previous
From: Chao Li
Date:
Subject: Re: Buffer locking is special (hints, checksums, AIO writes)
Next
From: Andreas Karlsson
Date:
Subject: Re: Add IS_INDEX macro to brin and gist index