aboutsummaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorKeith Busch <keith.busch@intel.com>2015-01-08 10:53:56 -0500
committerJens Axboe <axboe@fb.com>2015-01-08 10:53:56 -0500
commit3fd5940cb2e47a61dcff4108f39be4c72cb4dace (patch)
tree7cfa6e9965a573d0479a68ac878512769aa2a38e /block
parent17ded320706c6316376059cfbe9dccab32c62b42 (diff)
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 <keith.busch@intel.com> Modified by me to add a code comment on the need for the wakeup. Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'block')
-rw-r--r--block/blk-mq.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/block/blk-mq.c b/block/blk-mq.c
index cbd2a55d69b8..aefed96369dd 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -160,6 +160,13 @@ void blk_mq_wake_waiters(struct request_queue *q)
160 queue_for_each_hw_ctx(q, hctx, i) 160 queue_for_each_hw_ctx(q, hctx, i)
161 if (blk_mq_hw_queue_mapped(hctx)) 161 if (blk_mq_hw_queue_mapped(hctx))
162 blk_mq_tag_wakeup_all(hctx->tags, true); 162 blk_mq_tag_wakeup_all(hctx->tags, true);
163
164 /*
165 * If we are called because the queue has now been marked as
166 * dying, we need to ensure that processes currently waiting on
167 * the queue are notified as well.
168 */
169 wake_up_all(&q->mq_freeze_wq);
163} 170}
164 171
165bool blk_mq_can_queue(struct blk_mq_hw_ctx *hctx) 172bool blk_mq_can_queue(struct blk_mq_hw_ctx *hctx)