blk-mq: set plug->rq_count 0 after sort in blk_mq_flush_plug_list
PATCH 1/1 blk-mq: set plug->rq_count 0 after sort in blk_mq_flush_plug_list
Set plug->rq_count 0 earlier can skip possible sort. Move the 0-value set after sort.
Signed-off-by Shenghui Wang <[email protected]>
--- block/blk-mq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
block/blk-mq.c +1 -1
@@ -1711,10 +1711,10 @@ 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 ;
Signature · 1 line
2.20.1
Quoted 2 lines · Shenghui Wang
Set
plug->rq_count0 earlier can skip possible sort. Move the 0-value set after sort.
The same fix already exists at:
Dongli Zhang
Quoted 23 lines
Signed-off-by Shenghui Wang <[email protected]>--- block/blk-mq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)block/blk-mq.c +1
-1@@ -1711,10 +1711,10 @@ 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 ;