rnbd_rerun_all_if_idle(9)
π rnbd_rerun_all_if_idle β the kernel API tea π«
okay so bestie, this one lives in the Kernel API Manual and it's literally the cleanup crew for a very specific IO hang. let's get into it β¨
πΈ NAME πΈ
rnbd_rerun_all_if_idle β reruns all the queues left chillin' in the list, but only if the session is idling (meaning there are zero requests in-flight). no requests, no problem, we wake everybody up π
π¦ SYNOPSIS π¦
void rnbd_rerun_all_if_idle (struct rnbd_clt_session *sess );
π ARGUMENTS π
sessβ the session whose queues we're gonna rerun. that's the whole vibe check right there π«Ά
β¨ DESCRIPTION β¨
so basically this function tries to rerun all the stopped queues, but only once there are no requests in-flight anymore. it's solving a genuinely obvious little problem: what happens when the number of tags is < the number of queues (hctx) that got stopped and put to sleep π΄. if that last permit that just got put back doesn't wake up all the left queues (hctxs), your IO requests hang forever. and we are not doing forever hangs in this house π
here's the scenario where it goes down. say all N permits get exhausted from one CPU, and we've got many block devices per session β say M of them. every block device has its own queue (hctx) for each CPU, so eventually we can put that many queues (hctxs) to sleep: M x nr_cpu_ids. and if the number of permits N < M x nr_cpu_ids, wellβ¦ we end up with an IO hang π«
to dodge that hang, the last caller of rnbd_put_permit β and by last caller we mean the one who observes sess->busy == 0 β has got to wake up all the remaining queues. no cap, it's their moment, their main character energy π
β CONTEXT β
does not matter. literally does not matter. run it wherever, it's unbothered π§
π SEE ALSO π
- Kernel file
./drivers/block/rnbd/rnbd-clt.c rnbd_get_cpu_qlist(9)rnbd_rerun_if_needed(9)rnbd_clt_dev_add_to_requeue(9)
lowkey read those SEE ALSOs too bestie, they're all part of the same little rnbd-clt friend group π
and that's the whole page! this iconic lil number ships from ./drivers/block/rnbd, dated October 2026 β stay hydrated, keep your permits balanced, and don't let your queues sleep forever πππ
π¦ 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