Skip to content

Commit ff3b74b

Browse files
Yufen Yuaxboe
authored andcommitted
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. Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Yufen Yu <yuyufen@huawei.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent b9a1ff5 commit ff3b74b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

block/blk-mq.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2003,11 +2003,13 @@ static blk_qc_t blk_mq_make_request(struct request_queue *q, struct bio *bio)
20032003
plug->rq_count--;
20042004
}
20052005
blk_add_rq_to_plug(plug, rq);
2006+
trace_block_plug(q);
20062007

20072008
blk_mq_put_ctx(data.ctx);
20082009

20092010
if (same_queue_rq) {
20102011
data.hctx = same_queue_rq->mq_hctx;
2012+
trace_block_unplug(q, 1, true);
20112013
blk_mq_try_issue_directly(data.hctx, same_queue_rq,
20122014
&cookie, false, true);
20132015
}

0 commit comments

Comments
 (0)