Skip to content

Commit bcc816d

Browse files
Dongli Zhangaxboe
authored andcommitted
blk-mq: do not reset plug->rq_count before the list is sorted
We would never be able to sort the list if we first reset plug->rq_count which is used in conditional check later. Fixes: ce5b009 ("block: improve logic around when to sort a plug list") Reviewed-by: Ming Lei <ming.lei@redhat.com> Signed-off-by: Dongli Zhang <dongli.zhang@oracle.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 58ccd2d commit bcc816d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

block/blk-mq.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1711,11 +1711,12 @@ void blk_mq_flush_plug_list(struct blk_plug *plug, bool from_schedule)
17111711
unsigned int depth;
17121712

17131713
list_splice_init(&plug->mq_list, &list);
1714-
plug->rq_count = 0;
17151714

17161715
if (plug->rq_count > 2 && plug->multiple_queues)
17171716
list_sort(NULL, &list, plug_rq_cmp);
17181717

1718+
plug->rq_count = 0;
1719+
17191720
this_q = NULL;
17201721
this_hctx = NULL;
17211722
this_ctx = NULL;

0 commit comments

Comments
 (0)