public inbox for linux-block@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] blk-mq: remove blk_mq_alloc_tag_set_tags
@ 2022-11-09 10:08 Christoph Hellwig
  2022-11-09 10:08 ` [PATCH 2/2] blk-mq: simplify blk_mq_realloc_tag_set_tags Christoph Hellwig
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Christoph Hellwig @ 2022-11-09 10:08 UTC (permalink / raw)
  To: axboe; +Cc: linux-block

There is no point in trying to share any code with the realloc case when
all that is needed by the initial tagset allocation is a simple
kcalloc_node.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 block/blk-mq.c | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/block/blk-mq.c b/block/blk-mq.c
index 7ff3415c8eadc..8c630dbdf107e 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -4403,12 +4403,6 @@ static int blk_mq_realloc_tag_set_tags(struct blk_mq_tag_set *set,
 	return 0;
 }
 
-static int blk_mq_alloc_tag_set_tags(struct blk_mq_tag_set *set,
-				int new_nr_hw_queues)
-{
-	return blk_mq_realloc_tag_set_tags(set, 0, new_nr_hw_queues);
-}
-
 /*
  * Alloc a tag set to be associated with one or more request queues.
  * May fail with EINVAL for various error conditions. May adjust the
@@ -4471,11 +4465,13 @@ int blk_mq_alloc_tag_set(struct blk_mq_tag_set *set)
 			goto out_free_srcu;
 	}
 
-	ret = blk_mq_alloc_tag_set_tags(set, set->nr_hw_queues);
-	if (ret)
+	ret = -ENOMEM;
+	set->tags = kcalloc_node(set->nr_hw_queues,
+				 sizeof(struct blk_mq_tags *), GFP_KERNEL,
+				 set->numa_node);
+	if (!set->tags)
 		goto out_cleanup_srcu;
 
-	ret = -ENOMEM;
 	for (i = 0; i < set->nr_maps; i++) {
 		set->map[i].mq_map = kcalloc_node(nr_cpu_ids,
 						  sizeof(set->map[i].mq_map[0]),
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2022-11-22  6:55 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-09 10:08 [PATCH 1/2] blk-mq: remove blk_mq_alloc_tag_set_tags Christoph Hellwig
2022-11-09 10:08 ` [PATCH 2/2] blk-mq: simplify blk_mq_realloc_tag_set_tags Christoph Hellwig
2022-11-09 19:45   ` Chaitanya Kulkarni
2022-11-18 14:06   ` Shinichiro Kawasaki
2022-11-21  7:58     ` Christoph Hellwig
2022-11-21 11:14       ` Shinichiro Kawasaki
2022-11-21 13:19         ` Christoph Hellwig
2022-11-22  6:54           ` Shinichiro Kawasaki
2022-11-09 19:45 ` [PATCH 1/2] blk-mq: remove blk_mq_alloc_tag_set_tags Chaitanya Kulkarni
2022-11-10 18:18 ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox