blk_pm_runtime_init(9)
π blk_pm_runtime_init β the Kernel API Manual, bestie edition π
okay so this page is blk_pm_runtime_init(9) from the Kernel API Manual, and honestly? it's giving "tiny function, big responsibilities." let's get into it β¨
πΈ NAME πΈ
blk_pm_runtime_init β the Block layer runtime PM initialization routine. that's it, that's the name, no notes π
β¨ SYNOPSIS β¨
void blk_pm_runtime_init (struct request_queue *q , struct device *dev );
yup, that's the whole signature. void return, two pointers in, vibes out. π«Ά
π ARGUMENTS π
qβ the queue of the device. like, the actualstruct request_queue *, not a copy, not a vibe, the real one π₯devβ the device the queue belongs to.q's other half, its main character partner π
π¦ DESCRIPTION π¦
so what does this thing actually do? it initializes the runtime-PM-related fields for q and starts auto suspend for dev. lowkey iconic of it. β
here's the tea for drivers wanting to take advantage of request-based runtime PM β you call this function when all three of these are true:
devhas been initialized β- its request queue
qhas been allocated β - runtime PM for it can not happen yet β either because it's disabled/forbidden, or because its
usage_count > 0β
and in most cases? the driver should call this function before any I/O has taken place. like, do it early, bestie. don't be weird about it. π
this function handles setting things up using auto suspend for the device, and here's the spicy detail: the autosuspend delay is set to -1 to make runtime suspend impossible until an updated value is either set by the user or by the driver. so yeah, it's deliberately asleep-at-the-wheel until somebody gives it a real number π
the good news: drivers do not need to touch other autosuspend settings. it's handled. you're free. go live your life π
one more thing, and it's important so listen up: the block layer runtime PM is request based, so it only works for drivers that use request as their IO unit β not the ones that directly use bio's. periodt. π§
π SEE ALSO π
- Kernel file
./block/blk-pm.c blk_pre_runtime_suspend(9)blk_post_runtime_suspend(9)blk_pre_runtime_resume(9)blk_post_runtime_resume(9)
go read the whole saga, it's a series π
and that's the page!! this one came from ./block, October 2026, and it's the blk_pm_runtime_init(9) entry in the Kernel API Manual β mwah, slay, see u in the group chat πππΈ
π¦ 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