Skip to content

Commit

Permalink
linux: don't use io_uring on pre-5.10.186 kernels (libuv#4093)
Browse files Browse the repository at this point in the history
Those kernels have a known resource consumption bug where the sqpoll
thread busy-loops.

Fixes: libuv#4089
  • Loading branch information
bnoordhuis authored Jul 12, 2023
1 parent 1230fad commit 50b53cb
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/unix/linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -431,8 +431,14 @@ static int uv__use_io_uring(void) {
use = atomic_load_explicit(&use_io_uring, memory_order_relaxed);

if (use == 0) {
/* Older kernels have a bug where the sqpoll thread uses 100% CPU. */
use = uv__kernel_version() >= /* 5.10.186 */ 0x050ABA ? 1 : -1;

/* But users can still enable it if they so desire. */
val = getenv("UV_USE_IO_URING");
use = val == NULL || atoi(val) ? 1 : -1;
if (val != NULL)
use = atoi(val) ? 1 : -1;

atomic_store_explicit(&use_io_uring, use, memory_order_relaxed);
}

Expand Down

0 comments on commit 50b53cb

Please sign in to comment.