rq_qos_wait(9)
πΈ rq_qos_wait β kernel API manual, but make it make sense πΈ
okay bestie, welcome to the Kernel API Manual entry for rq_qos_wait(9) π
this one's a little throttle-y helper and honestly? she's iconic. let's get into it β¨
β¨ NAME β¨
rq_qos_wait β throttle on a rqw if we need to π«Ά
like, only if we actually need to. no cap.
π SYNOPSIS π
void rq_qos_wait (struct rq_wait *rqw , void *private_data ,
acquire_inflight_cb_t *acquire_inflight_cb , cleanup_cb_t *cleanup_cb );
π¦ ARGUMENTS π¦
rqwβ the rqw you're throttling on. yeah. that one. πprivate_dataβ caller-provided specific data, i.e. your own little bag of stuff you're bringing to the function πacquire_inflight_cbβ the callback that incs therqw->inflightcounter if we can. if we can't? it says no and we go night-night π΄cleanup_cbβ the callback to cleanup in case we race with a waker πββοΈπ¨
π DESCRIPTION π
so the whole point of this one is to give all the rq_qos users one uniform place to do their throttling. literally one spot. main character energy π
and the reason it matters: since you can end up with a lot of things sleeping at once, this thing manages the waking up based on the resources available. it's giving traffic control but make it β¨elegantβ¨
the acquire_inflight_cb should inc the rqw->inflight if we have the ability to do so. and if we don't? it returns false, and then we will sleep until the room becomes available. periodt. π€
cleanup_cb is there for in case we race with a waker and need to cleanup the inflight count accordingly β because races happen, and we handle them, slay π«Ά
π SEE ALSO π
- Kernel file
./block/blk-rq-qos.c
go read the source bestie, iykyk π₯
ok tiny vibe check: this is kernel-side throttling, so don't go calling it from your random userspace program thinking it's gonna sort your life out π also the callbacks are your responsibility β if your acquire_inflight_cb lies about grabbing the inflight slot, that's on you, not on the helper π
and that's the page!! π this one's from the ./block source, in the Kernel API Manual, dated October 2026 β rq_qos_wait(9), mwah π bye bestie, go throttle responsibly π§ββοΈπ
π¦ 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