Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752470AbcJ0G07 (ORCPT ); Thu, 27 Oct 2016 02:26:59 -0400 Received: from cmccmta2.chinamobile.com ([221.176.66.80]:19230 "EHLO cmccmta2.chinamobile.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751207AbcJ0G06 (ORCPT ); Thu, 27 Oct 2016 02:26:58 -0400 X-Greylist: delayed 365 seconds by postgrey-1.27 at vger.kernel.org; Thu, 27 Oct 2016 02:26:57 EDT X-RM-TRANSID: 2ee658119cb5d06-d0ade X-RM-SPAM-FLAG: 00000000 X-RM-TRANSID: 2ee558119cb46d5-2af6f From: Xiubo Li To: axboe@kernel.dk Cc: linux-kernel@vger.kernel.org, Xiubo Li Subject: [PATCH] blk-mq: remove the double hctx->numa_node init code. Date: Thu, 27 Oct 2016 14:19:27 +0800 Message-Id: <1477549167-11856-1-git-send-email-lixiubo@cmss.chinamobile.com> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1726 Lines: 61 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 --- 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