From e78e29c231481683c7e72450eeeb1b75b1109b2c Mon Sep 17 00:00:00 2001 From: Santiago Gimeno Date: Tue, 6 Aug 2024 22:10:13 +0200 Subject: linux: disable SQPOLL io_uring by default (#4492) The SQPOLL io_uring instance wasn't providing consistent behaviour to users depending on kernel versions, load shape, ... creating issues difficult to track and fix. Don't use this ring by default but allow enabling it by calling `uv_loop_configure()` with `UV_LOOP_ENABLE_IO_URING_SQPOLL`. --- src/unix/linux.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/unix/linux.c') diff --git a/src/unix/linux.c b/src/unix/linux.c index ad07430e..a5f74e89 100644 --- a/src/unix/linux.c +++ b/src/unix/linux.c @@ -761,6 +761,14 @@ static struct uv__io_uring_sqe* uv__iou_get_sqe(struct uv__iou* iou, * initialization failed. Anything else is a valid ring file descriptor. */ if (iou->ringfd == -2) { + /* By default, the SQPOLL is not created. Enable only if the loop is + * configured with UV_LOOP_USE_IO_URING_SQPOLL. + */ + if ((loop->flags & UV_LOOP_ENABLE_IO_URING_SQPOLL) == 0) { + iou->ringfd = -1; + return NULL; + } + uv__iou_init(loop->backend_fd, iou, 64, UV__IORING_SETUP_SQPOLL); if (iou->ringfd == -2) iou->ringfd = -1; /* "failed" */ -- cgit v1.2.3