Re: [PATCH] check kernel version for io_method

From: Andreas Karlsson <andreas(at)proxel(dot)se>
To: Steven Niu <niushiji(at)gmail(dot)com>, 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 03:09:35
Message-ID: d1b3e7c3-800d-4c5b-ac8e-f19373b7c0d3@proxel.se
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 1/14/26 3:31 AM, Steven Niu wrote:
> 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;
> + }

That code is unreachable so it should just be deleted. Look at the enum.

/* Enum for io_method GUC. */
typedef enum IoMethod
{
IOMETHOD_SYNC = 0,
IOMETHOD_WORKER,
#ifdef IOMETHOD_IO_URING_ENABLED
IOMETHOD_IO_URING,
#endif
} IoMethod;

Andreas

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Chao Li 2026-01-14 03:41:19 Re: Buffer locking is special (hints, checksums, AIO writes)
Previous Message Chao Li 2026-01-14 02:55:08 Re: New year, new commitfest app improvements