rq_qos_wait(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 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 the rqw->inflight counter 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