From: Raghavendra K T <raghavendra.kt@linux.vnet.ibm.com>
To: <axboe@kernel.dk>
Cc: <tom.leiming@gmail.com>, <linux-block@vger.kernel.org>,
<jmoyer@redhat.com>, <akinobu.mita@gmail.com>,
<nacc@linux.vnet.ibm.com>, <linux-kernel@vger.kernel.org>,
<raghavendra.kt@linux.vnet.ibm.com>
Subject: [PATCH] blk-mq: Reuse hardware context cpumask for tags
Date: Wed, 2 Dec 2015 16:57:06 +0530 [thread overview]
Message-ID: <1449055626-14439-1-git-send-email-raghavendra.kt@linux.vnet.ibm.com> (raw)
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 <raghavendra.kt@linux.vnet.ibm.com>
---
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
next reply other threads:[~2015-12-02 11:22 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-02 11:27 Raghavendra K T [this message]
2015-12-03 10:03 ` Sagi Grimberg
2015-12-03 16:56 ` Jens Axboe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1449055626-14439-1-git-send-email-raghavendra.kt@linux.vnet.ibm.com \
--to=raghavendra.kt@linux.vnet.ibm.com \
--cc=akinobu.mita@gmail.com \
--cc=axboe@kernel.dk \
--cc=jmoyer@redhat.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nacc@linux.vnet.ibm.com \
--cc=tom.leiming@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®