diff mbox series

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

Message ID 20190326131925.60255-1-yuyufen@huawei.com (mailing list archive)
State New, archived
Headers show
Series blk-mq: add trace block plug and unplug for multiple queues | expand

Commit Message

Yufen Yu March 26, 2019, 1:19 p.m. UTC
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.

Signed-off-by: Yufen Yu <yuyufen@huawei.com>
---
 block/blk-mq.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Christoph Hellwig March 27, 2019, 8:13 a.m. UTC | #1
On Tue, Mar 26, 2019 at 09:19:25PM +0800, Yufen Yu wrote:
> 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.
> 
> Signed-off-by: Yufen Yu <yuyufen@huawei.com>

Looks good,

Reviewed-by: Christoph Hellwig <hch@lst.de>
Yufen Yu April 2, 2019, 2:34 p.m. UTC | #2
ping ?


On 2019/3/27 16:13, Christoph Hellwig wrote:
> On Tue, Mar 26, 2019 at 09:19:25PM +0800, Yufen Yu wrote:
>> 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.
>>
>> Signed-off-by: Yufen Yu <yuyufen@huawei.com>
> Looks good,
>
> Reviewed-by: Christoph Hellwig <hch@lst.de>
>
> .
>
Jens Axboe April 2, 2019, 2:57 p.m. UTC | #3
On 3/26/19 7:19 AM, Yufen Yu wrote:
> 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.
diff mbox series

Patch

diff --git a/block/blk-mq.c b/block/blk-mq.c
index 5486c7d8b408..4aa673a6d285 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -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);
 		}