mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 02:50:49 +09:00
UPSTREAM: 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>
Change-Id: Ia85d5c75ef4f2bf3f90e4d3408cffec5c41dcfe2
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Bug: 274474142
(cherry picked from commit df87eb0fce)
Signed-off-by: Bart Van Assche <bvanassche@google.com>
This commit is contained in:
committed by
Bart Van Assche
parent
5d8f9f875e
commit
de29d65a35
@@ -17,7 +17,6 @@
|
||||
#include <linux/workqueue.h>
|
||||
#include <linux/smp.h>
|
||||
#include <linux/llist.h>
|
||||
#include <linux/list_sort.h>
|
||||
#include <linux/cpu.h>
|
||||
#include <linux/cache.h>
|
||||
#include <linux/sched/sysctl.h>
|
||||
@@ -1904,20 +1903,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);
|
||||
@@ -1925,10 +1910,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 {
|
||||
|
||||
Reference in New Issue
Block a user