From: Keith Busch Date: Thu, 8 Jan 2015 15:53:56 +0000 (-0700) Subject: blk-mq: Wake tasks entering queue on dying X-Git-Tag: v4.9.8~5006^2~11 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3fd5940cb2e47a61dcff4108f39be4c72cb4dace;p=platform%2Fkernel%2Flinux-rpi3.git blk-mq: Wake tasks entering queue on dying When the queue is set to dying, wake up tasks that are waiting on frozen queue so they realize it is dying and abandon their request. Signed-off-by: Keith Busch Modified by me to add a code comment on the need for the wakeup. Signed-off-by: Jens Axboe --- diff --git a/block/blk-mq.c b/block/blk-mq.c index cbd2a55..aefed96 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -160,6 +160,13 @@ void blk_mq_wake_waiters(struct request_queue *q) queue_for_each_hw_ctx(q, hctx, i) if (blk_mq_hw_queue_mapped(hctx)) blk_mq_tag_wakeup_all(hctx->tags, true); + + /* + * If we are called because the queue has now been marked as + * dying, we need to ensure that processes currently waiting on + * the queue are notified as well. + */ + wake_up_all(&q->mq_freeze_wq); } bool blk_mq_can_queue(struct blk_mq_hw_ctx *hctx)