Skip to contentSkip to conversation

blk-mq: Explain when 'active_queues' is decremented

PATCH In review Bart Van Assche 2 participants 2 messages Jan 10, 2018 Block layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 blk-mq: Explain when 'active_queues' is decremented

It is nontrivial to derive from the blk-mq source code when blk_mq_tags.active_queues is decremented. Hence add a comment that explains this.

Cc Christoph Hellwig <[email protected]>
Cc Hannes Reinecke <[email protected]>
Cc Johannes Thumshirn <[email protected]>
---
 block/blk-mq.c | 6 ++++++
 1 file changed, 6 insertions(+)
block/blk-mq.c +6 -0
index 9aa24c9508f9..266fc4f6b046 100644
@@ -954,6 +954,12 @@ static void blk_mq_timeout_work(struct work_struct *work)
 		data.next = blk_rq_timeout(round_jiffies_up(data.next));
 		mod_timer(&q->timeout, data.next);
 	} else {
+		/*
+		 * Request timeouts are handled as a forward rolling timer. If
+		 * we end up here it means that no requests are pending and
+		 * also that no request has been pending for a while. Mark
+		 * each hctx as idle.
+		 */
 		queue_for_each_hw_ctx(q, hctx, i) {
 			/* the hctx may be unmapped, so check it here */
 			if (blk_mq_hw_queue_mapped(hctx))
Signature · 1 line
2.15.1
maintainer
#1 lore raw
Quoted 3 lines · Bart Van Assche

It is nontrivial to derive from the blk-mq source code when blk_mq_tags.active_queues is decremented. Hence add a comment that explains this.

That is how it works, applied the patch, thanks Bart.

Signature · 1 line
Jens Axboe