blk_sync_queue(9)
π blk_sync_queue(9) β from the Kernel API Manual π
okay so bestie, this is the lowdown on blk_sync_queue from the Kernel API Manual. it's giving clean up your callbacks before you dip energy, and honestly? iconic. π
β¨ NAME β¨
blk_sync_queue β cancel any pending callbacks on a queue. no cap.
π SYNOPSIS π
void blk_sync_queue (struct request_queue *q );
π¦ ARGUMENTS π¦
qβ the queue. literally the queue in question, bestie.
π₯ DESCRIPTION π₯
so the block layer may perform asynchronous callback activity on a queue, like calling the unplug function after a timeout. yes, after a timeout β the drama of it all.
a block device may call blk_sync_queue to ensure that any such activity is cancelled, which lets it release resources that the callbacks might use. very βclear the runway so nothing crashes into your stuffβ of it.
β οΈ caveat time: the caller must already have made sure that its ->submit_bio will not re-add plugging prior to calling this function. like, that's a you problem before you call in β do the vibe check, bestie.
this function does not cancel any asynchronous activity arising out of elevator or throttling code. nope, not those. that would require elevator_exit and blkcg_exit_queue to be called with queue lock initialized.
π SEE ALSO π
Kernel file ./block/blk-core.c and the whole squad:
blk_queue_flag_set(9)blk_queue_flag_clear(9)blk_op_str(9)blk_set_pm_only(9)blk_put_queue(9)blk_queue_enter(9)blk_get_queue(9)submit_bio_noacct(9)submit_bio(9)bio_poll(9)bio_start_io_acct(9)blk_lld_busy(9)blk_start_plug(9)blk_finish_plug(9)
and that's the whole page, bestie π«Ά source/version: ./block β date: October 2026. mwah π
π¦ 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