swait_event_...ut_exclusive(9)
π€ 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 capconditionβ 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 truetimeoutβ 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 no1β 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 π
- Kernel file
./include/linux/swait.hπ β go read the source bestie, it's right there swait_active(9)swq_has_sleeper(9)swait_event_idle_exclusive(9)β the no-timeout cousin, same energy, infinite patience πΈ
π 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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms