lkml.org 
[lkml]   [2016]   [Oct]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] blk-mq: remove the double hctx->numa_node init code.
Date
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@cmss.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


\
 
 \ /
  Last update: 2016-10-27 08:27    [W:0.022 / U:0.228 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site