[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1477549167-11856-1-git-send-email-lixiubo@cmss.chinamobile.com>
Date: Thu, 27 Oct 2016 14:19:27 +0800
From: Xiubo Li <lixiubo@...s.chinamobile.com>
To: axboe@...nel.dk
Cc: linux-kernel@...r.kernel.org,
Xiubo Li <lixiubo@...s.chinamobile.com>
Subject: [PATCH] blk-mq: remove the double hctx->numa_node init code.
Since the commit f14bbe77a96bb ("blk-mq: pass in suggested NUMA
node to ->alloc_hctx()") has already computed and set the
suggested NUMA node for hctx, so this code here is reduntant.
Signed-off-by: Xiubo Li <lixiubo@...s.chinamobile.com>
---
block/blk-mq.c | 19 ++-----------------
1 file changed, 2 insertions(+), 17 deletions(-)
diff --git a/block/blk-mq.c b/block/blk-mq.c
index 4c0622f..ab86716 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -1767,33 +1767,18 @@ static int blk_mq_init_hw_queues(struct request_queue *q,
return 1;
}
-static void blk_mq_init_cpu_queues(struct request_queue *q,
- unsigned int nr_hw_queues)
+static void blk_mq_init_cpu_queues(struct request_queue *q)
{
unsigned int i;
for_each_possible_cpu(i) {
struct blk_mq_ctx *__ctx = per_cpu_ptr(q->queue_ctx, i);
- struct blk_mq_hw_ctx *hctx;
memset(__ctx, 0, sizeof(*__ctx));
__ctx->cpu = i;
spin_lock_init(&__ctx->lock);
INIT_LIST_HEAD(&__ctx->rq_list);
__ctx->queue = q;
-
- /* If the cpu isn't online, the cpu is mapped to first hctx */
- if (!cpu_online(i))
- continue;
-
- hctx = q->mq_ops->map_queue(q, i);
-
- /*
- * Set local node, IFF we have more than one hw queue. If
- * not, we remain on the home node of the device
- */
- if (nr_hw_queues > 1 && hctx->numa_node == NUMA_NO_NODE)
- hctx->numa_node = local_memory_node(cpu_to_node(i));
}
}
@@ -2046,7 +2031,7 @@ struct request_queue *blk_mq_init_allocated_queue(struct blk_mq_tag_set *set,
if (set->ops->complete)
blk_queue_softirq_done(q, set->ops->complete);
- blk_mq_init_cpu_queues(q, set->nr_hw_queues);
+ blk_mq_init_cpu_queues(q);
if (blk_mq_init_hw_queues(q, set))
goto err_hctxs;
--
1.8.3.1
Powered by blists - more mailing lists