On Wed, Jul 19, 2023 at 11:22:42AM -0700, Bart Van Assche wrote: > blk_mq_run_queue() runs the queue asynchronously if BLK_MQ_F_BLOCKING > has been set. Maybe something like: blk_mq_run_queue() always runs the queue asynchronously if BLK_MQ_F_BLOCKING is set on the tag_set. > + * for execution. Don't wait for completion. May sleep if BLK_MQ_F_BLOCKING > + * has been set. > * > * Note: > * This function will invoke @done directly if the queue is dead. > @@ -2213,6 +2214,8 @@ void blk_mq_run_hw_queue(struct blk_mq_hw_ctx *hctx, bool async) > */ > WARN_ON_ONCE(!async && in_interrupt()); > > + might_sleep_if(!async && hctx->flags & BLK_MQ_F_BLOCKING); This is some odd an very complex calling conventions. I suspect most !BLK_MQ_F_BLOCKING could also deal with the may sleep if not async, and that would give us a much easier to audit change as we could remove the WARN_ON_ONCE above and just do a: might_sleep_if(!async); In fact this might be a good time to split up blk_mq_run_hw_queue into blk_mq_run_hw_queue and blk_mq_run_hw_queue_async and do away with the bool and have cristal clear calling conventions. If we really need !async calles than can sleep we can add a specific blk_mq_run_hw_queue_atomic.