io_uring_set_iowait(3)
π€ io_uring_set_iowait β bestie edition π€
okay so this one is from the liburing Manual and it's literally the little switch that decides whether your waiting task gets marked as iowait while it's snoozing on events. that's it. that's the whole vibe. π¦
β¨ NAME β¨
io_uring_set_iowait β toggle of iowait usage when waiting on CQEs
πΈ SYNOPSIS πΈ
#include <liburing.h>
int io_uring_set_iowait(struct io_uring *ring,
bool enable_iowait);
π DESCRIPTION π
so here's the tea. by default, io_uring marks a waiting task as being in iowait if it's sleeping waiting on events and there are pending requests. like, that's the default behavior, no cap.
but bestieβ¦ that isn't necessarily always useful π and it may be confusing on non-storage setups where iowait isn't expected. it can also cause extra power usage by preventing the CPU from entering lower sleep states. so it's giving "why is my CPU not napping" energy. π
and that's where io_uring_set_iowait(3) comes in β it lets you toggle this behavior, queen π
- if
enable_iowaitis set totrue, the iowait behavior is enabled β - if it is set to
false, the iowait behavior is disabled β
and the iowait behavior is enabled by default when a ring is created, so it's opt-out, not opt-in. iykyk.
if the iowait is disabled, the submit functions will set IORING_ENTER_NO_IOWAIT in the flags argument to io_uring_enter(2). π«Ά
if the kernel supports this feature, it will be marked by having the IORING_FEAT_NO_IOWAIT feature flag set. so that's your vibe check for whether your kernel is in on the joke.
available since kernel 6.15 β
π₯ RETURN VALUE π₯
- on success,
io_uring_set_iowait(3)returns0β slay π - on failure, it returns
-EOPNOTSUPP
π SEE ALSO π
and that's the whole page fr fr π this was written from the liburing-2.12 manual, dated July 27, 2025 β go forth and let your CPU nap, bestie πβ¨π
π¦ where this page comes from
- alpine 3.23: liburing-doc 2.12-r0 Β· LGPL-2.1-or-later OR MIT
- alpine 3.24: liburing-doc 2.14-r0 Β· LGPL-2.1-or-later OR MIT
- arch rolling: liburing 2.15-1 Β· GPL-2.0-only WITH Linux-syscall-note OR MIT AND LGPL-2.0-or-later AND MIT
- centos-stream 10: liburing-devel 2.12-1.el10 Β· (GPLv2 with exceptions and LGPLv2+) or MIT
- centos-stream 9: liburing-devel 2.12-1.el9 Β· (GPLv2 with exceptions and LGPLv2+) or MIT
- centos-stream 9: liburing-devel 2.12-1.el9 Β· (GPLv2 with exceptions and LGPLv2+) or MIT
- fedora 44: liburing-devel 2.13-2.fc44 Β· (GPL-2.0-only WITH Linux-syscall-note OR MIT) AND (LGPL-2.0-or-later OR MIT)
- fedora 44: liburing-devel 2.13-2.fc44 Β· (GPL-2.0-only WITH Linux-syscall-note OR MIT) AND (LGPL-2.0-or-later OR MIT)
- nixpkgs unstable: liburing 2.14
- ubuntu resolute: liburing-dev 2.14-1
- ubuntu stonking: liburing-dev 2.15-1
- π the page's license: LGPL-2.0-or-later
- Copyright (C) 2025 Jens Axboe <axboe@kernel.dk>
- Copyright (C) 2025 Ammar Faizi <ammarfaizi2@gnuweeb.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms