Skip to content

Commit a666e68

Browse files
committed
io/uring/Ring: Mark the io_uring as non-iowait%
Linux 6.15 introduced io_uring_set_iowait(3) which allows user to disable the wa% on waiting io_uring. The error code is intentionally ignored, as the function call will fail on earlier Linux system, and a macro guard is added to allow build to succeed on liburing < 2.10. This commit fixes #2241.
1 parent 6c5fca0 commit a666e68

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/io/uring/Ring.cxx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,21 @@ Ring::Ring(unsigned entries, unsigned flags)
1212
if (int error = io_uring_queue_init(entries, &ring, flags);
1313
error < 0)
1414
throw MakeErrno(-error, "io_uring_queue_init() failed");
15+
#if !IO_URING_CHECK_VERSION(2, 10)
16+
// Intentionally ignore the error code, as this is only supported on Linux 6.15+
17+
(void) io_uring_set_iowait(&ring, false);
18+
#endif
1519
}
1620

1721
Ring::Ring(unsigned entries, struct io_uring_params &params)
1822
{
1923
if (int error = io_uring_queue_init_params(entries, &ring, &params);
2024
error < 0)
2125
throw MakeErrno(-error, "io_uring_queue_init_params() failed");
26+
#if !IO_URING_CHECK_VERSION(2, 10)
27+
// Intentionally ignore the error code, as this is only supported on Linux 6.15+
28+
(void) io_uring_set_iowait(&ring, false);
29+
#endif
2230
}
2331

2432
void

0 commit comments

Comments
 (0)