aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2016-09-14 10:18:59 -0400
committerJens Axboe <axboe@fb.com>2016-09-15 10:42:03 -0400
commit1b157939f92ae22d10b9d52baaa14f826927f5ff (patch)
tree8e0656c97a3d19bd8936e6484b91d03ed7965fac
parentb5af7f2ff022a75eb0bbf2166007c4b8ddd02ef1 (diff)
blk-mq: get rid of the cpumask in struct blk_mq_tags
Unused now that NVMe sets up irq affinity before calling into blk-mq. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Keith Busch <keith.busch@intel.com> Signed-off-by: Jens Axboe <axboe@fb.com>
-rw-r--r--block/blk-mq-tag.c6
-rw-r--r--block/blk-mq-tag.h1
-rw-r--r--block/blk-mq.c25
-rw-r--r--include/linux/blk-mq.h1
4 files changed, 21 insertions, 12 deletions
diff --git a/block/blk-mq-tag.c b/block/blk-mq-tag.c
index 16028130289f..2eae3d5f7145 100644
--- a/block/blk-mq-tag.c
+++ b/block/blk-mq-tag.c
@@ -665,11 +665,6 @@ struct blk_mq_tags *blk_mq_init_tags(unsigned int total_tags,
665 if (!tags) 665 if (!tags)
666 return NULL; 666 return NULL;
667 667
668 if (!zalloc_cpumask_var(&tags->cpumask, GFP_KERNEL)) {
669 kfree(tags);
670 return NULL;
671 }
672
673 tags->nr_tags = total_tags; 668 tags->nr_tags = total_tags;
674 tags->nr_reserved_tags = reserved_tags; 669 tags->nr_reserved_tags = reserved_tags;
675 670
@@ -680,7 +675,6 @@ void blk_mq_free_tags(struct blk_mq_tags *tags)
680{ 675{
681 bt_free(&tags->bitmap_tags); 676 bt_free(&tags->bitmap_tags);
682 bt_free(&tags->breserved_tags); 677 bt_free(&tags->breserved_tags);
683 free_cpumask_var(tags->cpumask);
684 kfree(tags); 678 kfree(tags);
685} 679}
686 680
diff --git a/block/blk-mq-tag.h b/block/blk-mq-tag.h
index d468a79f2c4a..556964134d1c 100644
--- a/block/blk-mq-tag.h
+++ b/block/blk-mq-tag.h
@@ -44,7 +44,6 @@ struct blk_mq_tags {
44 struct list_head page_list; 44 struct list_head page_list;
45 45
46 int alloc_policy; 46 int alloc_policy;
47 cpumask_var_t cpumask;
48}; 47};
49 48
50 49
diff --git a/block/blk-mq.c b/block/blk-mq.c
index a3060078a8da..060b350d3f0c 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -1861,7 +1861,6 @@ static void blk_mq_map_swqueue(struct request_queue *q,
1861 hctx->tags = set->tags[i]; 1861 hctx->tags = set->tags[i];
1862 WARN_ON(!hctx->tags); 1862 WARN_ON(!hctx->tags);
1863 1863
1864 cpumask_copy(hctx->tags->cpumask, hctx->cpumask);
1865 /* 1864 /*
1866 * Set the map size to the number of mapped software queues. 1865 * Set the map size to the number of mapped software queues.
1867 * This is more accurate and more efficient than looping 1866 * This is more accurate and more efficient than looping
@@ -2272,11 +2271,29 @@ static int blk_mq_alloc_rq_maps(struct blk_mq_tag_set *set)
2272 return 0; 2271 return 0;
2273} 2272}
2274 2273
2275struct cpumask *blk_mq_tags_cpumask(struct blk_mq_tags *tags) 2274static int blk_mq_create_mq_map(struct blk_mq_tag_set *set,
2275 const struct cpumask *affinity_mask)
2276{ 2276{
2277 return tags->cpumask; 2277 int queue = -1, cpu = 0;
2278
2279 set->mq_map = kzalloc_node(sizeof(*set->mq_map) * nr_cpu_ids,
2280 GFP_KERNEL, set->numa_node);
2281 if (!set->mq_map)
2282 return -ENOMEM;
2283
2284 if (!affinity_mask)
2285 return 0; /* map all cpus to queue 0 */
2286
2287 /* If cpus are offline, map them to first hctx */
2288 for_each_online_cpu(cpu) {
2289 if (cpumask_test_cpu(cpu, affinity_mask))
2290 queue++;
2291 if (queue >= 0)
2292 set->mq_map[cpu] = queue;
2293 }
2294
2295 return 0;
2278} 2296}
2279EXPORT_SYMBOL_GPL(blk_mq_tags_cpumask);
2280 2297
2281/* 2298/*
2282 * Alloc a tag set to be associated with one or more request queues. 2299 * Alloc a tag set to be associated with one or more request queues.
diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h
index 6737fd7946f4..c5a97d7cef93 100644
--- a/include/linux/blk-mq.h
+++ b/include/linux/blk-mq.h
@@ -201,7 +201,6 @@ struct request *blk_mq_alloc_request(struct request_queue *q, int rw,
201struct request *blk_mq_alloc_request_hctx(struct request_queue *q, int op, 201struct request *blk_mq_alloc_request_hctx(struct request_queue *q, int op,
202 unsigned int flags, unsigned int hctx_idx); 202 unsigned int flags, unsigned int hctx_idx);
203struct request *blk_mq_tag_to_rq(struct blk_mq_tags *tags, unsigned int tag); 203struct request *blk_mq_tag_to_rq(struct blk_mq_tags *tags, unsigned int tag);
204struct cpumask *blk_mq_tags_cpumask(struct blk_mq_tags *tags);
205 204
206enum { 205enum {
207 BLK_MQ_UNIQUE_TAG_BITS = 16, 206 BLK_MQ_UNIQUE_TAG_BITS = 16,