Bug: https://github.com/libuv/libuv/issues/4089
Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/libuv1/+bug/
2046442
Origin: upstream, https://github.com/libuv/libuv/commit/
50b53cbd0db8d4e7be06939a0976ff520e791d31
Applied-Upstream: v1.47.0
Fixes: https://github.com/libuv/libuv/issues/4089
thread busy-loops.
Gbp-Pq: Name lp2046442-linux-don-t-use-io_uring-on-pre-5.10.186-kernels-409.patch
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);
}