summaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2021-10-18 10:08:49 -0600
committerJens Axboe <axboe@kernel.dk>2021-10-19 05:55:26 -0600
commitdf87eb0fce8fc891b43199447b9aeb3ea2d39bcf (patch)
tree5634ffc8ccf7e2e579a6d7b296b0fda7dc625116 /block
parent87c037d11b83b93e9ab5eda9fb03c114f67024ff (diff)
block: get rid of plug list sorting
Even if we have multiple queues in the plug list, chances that they are very interspersed is minimal. Don't bother spending CPU cycles sorting the list. Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block')
-rw-r--r--block/blk-mq.c19
1 files changed, 0 insertions, 19 deletions
diff --git a/block/blk-mq.c b/block/blk-mq.c
index 335ec3a7eab7..104019c0ea41 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -19,7 +19,6 @@
#include <linux/smp.h>
#include <linux/interrupt.h>
#include <linux/llist.h>
-#include <linux/list_sort.h>
#include <linux/cpu.h>
#include <linux/cache.h>
#include <linux/sched/sysctl.h>
@@ -2161,20 +2160,6 @@ void blk_mq_insert_requests(struct blk_mq_hw_ctx *hctx, struct blk_mq_ctx *ctx,
spin_unlock(&ctx->lock);
}
-static int plug_rq_cmp(void *priv, const struct list_head *a,
- const struct list_head *b)
-{
- struct request *rqa = container_of(a, struct request, queuelist);
- struct request *rqb = container_of(b, struct request, queuelist);
-
- if (rqa->mq_ctx != rqb->mq_ctx)
- return rqa->mq_ctx > rqb->mq_ctx;
- if (rqa->mq_hctx != rqb->mq_hctx)
- return rqa->mq_hctx > rqb->mq_hctx;
-
- return blk_rq_pos(rqa) > blk_rq_pos(rqb);
-}
-
void blk_mq_flush_plug_list(struct blk_plug *plug, bool from_schedule)
{
LIST_HEAD(list);
@@ -2182,10 +2167,6 @@ void blk_mq_flush_plug_list(struct blk_plug *plug, bool from_schedule)
if (list_empty(&plug->mq_list))
return;
list_splice_init(&plug->mq_list, &list);
-
- if (plug->rq_count > 2 && plug->multiple_queues)
- list_sort(NULL, &list, plug_rq_cmp);
-
plug->rq_count = 0;
do {