Skip to contentSkip to conversation

blk-mq: add trace block plug and unplug for multiple queues

PATCH Applied Yufen Yu 3 participants 4 messages Mar 26, 2019 – Apr 2, 2019 Block layer

lore
Share & tools
lore

Yufen Yu

author
#0 lore raw

PATCH 1/1 blk-mq: add trace block plug and unplug for multiple queues

For now, we just trace plug for single queue device or drivers provide .commit_rqs, and have not trace plug for multiple queues device. But, unplug events will be recorded when call blk_mq_flush_plug_list(). Then, trace events will be asymmetrical, just have unplug and without plug.

This patch add trace plug and unplug for multiple queues device in blk_mq_make_request(). After that, we can accurately trace plug and unplug for multiple queues.

---
 block/blk-mq.c | 2 ++
 1 file changed, 2 insertions(+)
block/blk-mq.c +2 -0
index 5486c7d8b408..4aa673a6d285 100644
@@ -1987,11 +1987,13 @@ static blk_qc_t blk_mq_make_request(struct request_queue *q, struct bio *bio)
 			plug->rq_count--;
 		}
 		blk_add_rq_to_plug(plug, rq);
+		trace_block_plug(q);
 
 		blk_mq_put_ctx(data.ctx);
 
 		if (same_queue_rq) {
 			data.hctx = same_queue_rq->mq_hctx;
+			trace_block_unplug(q, 1, true);
 			blk_mq_try_issue_directly(data.hctx, same_queue_rq,
 					&cookie, false, true);
 		}
Signature · 1 line
2.16.2.dirty
Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · Yufen Yu

For now, we just trace plug for single queue device or drivers provide .commit_rqs, and have not trace plug for multiple queues device. But, unplug events will be recorded when call blk_mq_flush_plug_list(). Then, trace events will be asymmetrical, just have unplug and without plug.

This patch add trace plug and unplug for multiple queues device in blk_mq_make_request(). After that, we can accurately trace plug and unplug for multiple queues.

Looks good,

author
#2 lore raw

ping ?

Quoted 18 lines · Christoph Hellwig
Quoted 11 lines · Yufen Yu

For now, we just trace plug for single queue device or drivers provide .commit_rqs, and have not trace plug for multiple queues device. But, unplug events will be recorded when call blk_mq_flush_plug_list(). Then, trace events will be asymmetrical, just have unplug and without plug.

This patch add trace plug and unplug for multiple queues device in blk_mq_make_request(). After that, we can accurately trace plug and unplug for multiple queues.

Looks good,

.

maintainer Applied
#3 lore raw
In reply to Yufen Yu
Quoted 9 lines · Yufen Yu

For now, we just trace plug for single queue device or drivers provide .commit_rqs, and have not trace plug for multiple queues device. But, unplug events will be recorded when call blk_mq_flush_plug_list(). Then, trace events will be asymmetrical, just have unplug and without plug.

This patch add trace plug and unplug for multiple queues device in blk_mq_make_request(). After that, we can accurately trace plug and unplug for multiple queues.

Applied, thanks.

Signature · 1 line
Jens Axboe