might_sleep(9)
π NAME π
might_sleep β annotation for functions that can sleep π΄β¨
hey bestie, welcome to the Kernel API Manual page for might_sleep(9) β we're keeping it cute and keeping every fact, periodt π
β¨ SYNOPSIS β¨
might_sleep
π¦ DESCRIPTION π¦
okay so here's the vibe: might_sleep is a macro, and if it runs in an atomic context β think a spinlock, an irq-handler, ... β that whole situation β it will print a stack trace ππ₯. Like, not me catching you trying to block where blocking is literally not allowed.
if you have additional sections where blocking is not allowed, you can annotate them with non_block_start and non_block_end pairs π«Ά.
this is such a useful debugging help, no cap: it lets you catch problems early and avoids getting bitten later when the calling function happens to sleep when it is not supposed to ππ .
πΈ SEE ALSO πΈ
- Kernel file
./include/linux/kernel.h cant_sleep(9)cant_migrate(9)non_block_start(9)non_block_end(9)enum system_states(9)
mwah π source/version cutie: ./include/linux; date: October 2026; page: might_sleep(9) β signing off, slay and read your kernel headers πβ¨
π¦ 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