might_sleep(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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 🌸


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