mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 01:49:46 +00:00
blk-mq: do not reset plug->rq_count before the list is sorted
[ Upstream commitbcc816dfe5] We would never be able to sort the list if we first reset plug->rq_count which is used in conditional check later. Fixes:ce5b009cff("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> Signed-off-by: Sasha Levin (Microsoft) <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
9bc06b41fd
commit
2c52a30e21
@@ -1716,11 +1716,12 @@ void blk_mq_flush_plug_list(struct blk_plug *plug, bool from_schedule)
|
||||
unsigned int depth;
|
||||
|
||||
list_splice_init(&plug->mq_list, &list);
|
||||
plug->rq_count = 0;
|
||||
|
||||
if (plug->rq_count > 2 && plug->multiple_queues)
|
||||
list_sort(NULL, &list, plug_rq_cmp);
|
||||
|
||||
plug->rq_count = 0;
|
||||
|
||||
this_q = NULL;
|
||||
this_hctx = NULL;
|
||||
this_ctx = NULL;
|
||||
|
||||
Reference in New Issue
Block a user