swait_event_...ut_exclusive(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’€ swait_event_...ut_exclusive(9) β€” the kernel API manual, bestie edition πŸ’€

okay so bestie, welcome to the swait_event_...ut_exclusive(9) page from the Kernel API Manual ✨ this one is short and sweet and honestly it's giving "quiet kid in the back of the class who's actually a genius" energy πŸŽ€


✨ NAME ✨

swait_event_idle_timeout_exclusive β€” wait up to timeout without load contribution πŸ¦‹

like, you're gonna nap, but the system load counters are NOT gonna be catching strays because of you. considerate queen behaviour honestly πŸ’…


🫢 SYNOPSIS 🫢

swait_event_idle_timeout_exclusive (wq , condition , timeout );

yes the spaces before those commas are exactly like that, don't come for me, that's literally what the page says 😭 copy it character for character or don't copy it at all πŸ™ˆ


🌸 ARGUMENTS 🌸

  • wq β€” the waitqueue to wait on πŸ’€ like, the actual thing you're parking yourself on, no cap
  • condition β€” a C expression for the event to wait for πŸ‘‘ this is the vibe check: it gets evaluated, and you keep waiting until it comes back true
  • timeout β€” timeout at which we'll give up, in jiffies ⏳ that's the clock-out time, the "okay I'm leaving" moment

πŸ’– DESCRIPTION πŸ’–

so here's the tea πŸ“ the process gets put to sleep (specifically TASK_IDLE) until the condition evaluates to true. and the condition gets checked each time the waitqueue wq is woken up β€” so every wakeup is basically a "hey bestie, is it true yet?" moment πŸ”₯

this function is mostly used when a kthread or workqueue waits for some condition and doesn't want to contribute to system load 🌈 that's the whole point of the idle in the name, iykyk. you're waiting, but you're not out here inflating the load average and making the system look busy when it isn't. main character energy who doesn't steal the spotlight 🧚

and the best part? Signals are ignored. 😭 like, truly unbothered. nothing's gonna interrupt this nap. periodt.

⭐ RETURN ⭐

okay so it returns a number and the number tells you a whole story:

  • 0 β€” the condition evaluated to false after the timeout elapsed πŸ’€ you waited the whole time and it was a no
  • 1 β€” the condition evaluated to true after the timeout elapsed 🫢 technically late, but technically correct
  • the remaining jiffies (at least 1) β€” the condition evaluated to true before the timeout elapsed πŸ‘‘ early slay, and it tells you exactly how many jiffies you had left over

so like, 0 is the flop, 1 is the "right answer, wrong timing", and anything >= 1 from the third case is "we ate and we have leftovers" πŸ’œ


πŸ” SEE ALSO πŸ”


πŸ’€ lowkey reminder: those (9) numbers mean section 9 of the manual β€” kernel API stuff. that's your iykyk for the day.

and that's the whole page, bestie!! πŸŽ€ this little gem lives in the kernel source tree at ./include/linux, and it's dated October 2026 β€” so go forth, nap responsibly, and remember: wait in TASK_IDLE, contribute nothing to load, leave with your remaining jiffies πŸ’…βœ¨

πŸ“¦ where this page comes from