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_iowait is set to true, 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 πŸ”₯


πŸ‘‘ 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