aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYufen Yu <yuyufen@huawei.com>2019-03-26 09:19:25 -0400
committerJens Axboe <axboe@kernel.dk>2019-04-02 10:57:05 -0400
commitff3b74b8e1675c802e09157a56c97ca38a659b9d (patch)
tree2bcf6917ee428014a7645dc806e51a34ffbc79e4
parentb9a1ff504b9492ad6beb7d5606e0e3365d4d8499 (diff)
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>
-rw-r--r--block/blk-mq.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/block/blk-mq.c b/block/blk-mq.c
index f3b0d33bdf88..22074a1e37cd 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -2003,11 +2003,13 @@ static blk_qc_t blk_mq_make_request(struct request_queue *q, struct bio *bio)
2003 plug->rq_count--; 2003 plug->rq_count--;
2004 } 2004 }
2005 blk_add_rq_to_plug(plug, rq); 2005 blk_add_rq_to_plug(plug, rq);
2006 trace_block_plug(q);
2006 2007
2007 blk_mq_put_ctx(data.ctx); 2008 blk_mq_put_ctx(data.ctx);
2008 2009
2009 if (same_queue_rq) { 2010 if (same_queue_rq) {
2010 data.hctx = same_queue_rq->mq_hctx; 2011 data.hctx = same_queue_rq->mq_hctx;
2012 trace_block_unplug(q, 1, true);
2011 blk_mq_try_issue_directly(data.hctx, same_queue_rq, 2013 blk_mq_try_issue_directly(data.hctx, same_queue_rq,
2012 &cookie, false, true); 2014 &cookie, false, true);
2013 } 2015 }