All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCHv2 1/2] blk-mq: allow timer to freeze its own queue
@ 2015-11-24 18:35 Keith Busch
  2015-11-24 18:35 ` [PATCHv2 2/2] NVMe: Shutdown fixes Keith Busch
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Keith Busch @ 2015-11-24 18:35 UTC (permalink / raw)


This patch removes synchronizing the timeout work so that the timer can
start a freeze on its own queue. The timer enters the queue, so timer
context can only start a freeze, but not wait for frozen.

Signed-off-by: Keith Busch <keith.busch at intel.com>
---
 block/blk-mq.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/block/blk-mq.c b/block/blk-mq.c
index 5142219..2714c9c2 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -85,7 +85,6 @@ void blk_mq_freeze_queue_start(struct request_queue *q)
 	freeze_depth = atomic_inc_return(&q->mq_freeze_depth);
 	if (freeze_depth == 1) {
 		percpu_ref_kill(&q->q_usage_counter);
-		cancel_work_sync(&q->timeout_work);
 		blk_mq_run_hw_queues(q, false);
 	}
 }
@@ -628,6 +627,9 @@ static void blk_mq_timeout_work(struct work_struct *work)
 	};
 	int i;
 
+	if (blk_queue_enter(q, true))
+		return;
+
 	blk_mq_queue_tag_busy_iter(q, blk_mq_check_expired, &data);
 
 	if (data.next_set) {
@@ -642,6 +644,7 @@ static void blk_mq_timeout_work(struct work_struct *work)
 				blk_mq_tag_idle(hctx);
 		}
 	}
+	blk_queue_exit(q);
 }
 
 /*
-- 
2.6.2.307.g37023ba

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-11-24 20:57 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-24 18:35 [PATCHv2 1/2] blk-mq: allow timer to freeze its own queue Keith Busch
2015-11-24 18:35 ` [PATCHv2 2/2] NVMe: Shutdown fixes Keith Busch
2015-11-24 19:42   ` Jens Axboe
2015-11-24 20:20     ` Keith Busch
2015-11-24 20:26       ` Jens Axboe
2015-11-24 20:57         ` Keith Busch
2015-11-24 19:42 ` [PATCHv2 1/2] blk-mq: allow timer to freeze its own queue Jens Axboe
2015-11-24 19:47 ` Christoph Hellwig

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.