Skip to content

Commit acc8c0a

Browse files
keithbuschaxboe
authored andcommitted
blk-mq: add missing unplug trace event
The single-queue optimized list flush doesn't have an unplug trace event to pair with the plug event. Add one. In the unlikely event an error occurs and falls back to the less optimized plug flush path, it's possible a 2nd unplug trace event will be logged, but it will show the remainig count that weren't previously handled. Signed-off-by: Keith Busch <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent a02e98b commit acc8c0a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

block/blk-mq.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2753,6 +2753,7 @@ static void blk_mq_dispatch_plug_list(struct blk_plug *plug, bool from_sched)
27532753
void blk_mq_flush_plug_list(struct blk_plug *plug, bool from_schedule)
27542754
{
27552755
struct request *rq;
2756+
unsigned int depth;
27562757

27572758
/*
27582759
* We may have been called recursively midway through handling
@@ -2763,13 +2764,15 @@ void blk_mq_flush_plug_list(struct blk_plug *plug, bool from_schedule)
27632764
*/
27642765
if (plug->rq_count == 0)
27652766
return;
2767+
depth = plug->rq_count;
27662768
plug->rq_count = 0;
27672769

27682770
if (!plug->multiple_queues && !plug->has_elevator && !from_schedule) {
27692771
struct request_queue *q;
27702772

27712773
rq = rq_list_peek(&plug->mq_list);
27722774
q = rq->q;
2775+
trace_block_unplug(q, depth, true);
27732776

27742777
/*
27752778
* Peek first request and see if we have a ->queue_rqs() hook.

0 commit comments

Comments
 (0)