Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757967AbbLBLWU (ORCPT ); Wed, 2 Dec 2015 06:22:20 -0500 Received: from e39.co.us.ibm.com ([32.97.110.160]:44910 "EHLO e39.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757953AbbLBLWS (ORCPT ); Wed, 2 Dec 2015 06:22:18 -0500 X-IBM-Helo: d01dlp03.pok.ibm.com X-IBM-MailFrom: raghavendra.kt@linux.vnet.ibm.com X-IBM-RcptTo: linux-block@vger.kernel.org;linux-kernel@vger.kernel.org From: Raghavendra K T To: Cc: , , , , , , Subject: [PATCH] blk-mq: Reuse hardware context cpumask for tags Date: Wed, 2 Dec 2015 16:57:06 +0530 Message-Id: <1449055626-14439-1-git-send-email-raghavendra.kt@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.11.7 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15120211-0033-0000-0000-00000711B73D Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1473 Lines: 45 hctx->cpumask is already populated and let the tag cpumask follow that instead of going through a new for loop. Signed-off-by: Raghavendra K T --- block/blk-mq.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) Nish had suggested to put cpumask_copy after WARN_ON (instead of before). diff --git a/block/blk-mq.c b/block/blk-mq.c index 6d6f8fe..6ada3b4 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -1854,6 +1854,7 @@ static void blk_mq_map_swqueue(struct request_queue *q, hctx->tags = set->tags[i]; WARN_ON(!hctx->tags); + cpumask_copy(hctx->tags->cpumask, hctx->cpumask); /* * Set the map size to the number of mapped software queues. * This is more accurate and more efficient than looping @@ -1867,14 +1868,6 @@ static void blk_mq_map_swqueue(struct request_queue *q, hctx->next_cpu = cpumask_first(hctx->cpumask); hctx->next_cpu_batch = BLK_MQ_CPU_WORK_BATCH; } - - queue_for_each_ctx(q, ctx, i) { - if (!cpumask_test_cpu(i, online_mask)) - continue; - - hctx = q->mq_ops->map_queue(q, i); - cpumask_set_cpu(i, hctx->tags->cpumask); - } } static void queue_set_hctx_shared(struct request_queue *q, bool shared) -- 1.7.11.7 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/