From: Yu Kuai <yukuai1@huaweicloud.com>
To: axboe@kernel.dk, hare@suse.de, nilay@linux.ibm.com, ming.lei@redhat.com
Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
yukuai3@huawei.com, yukuai1@huaweicloud.com, yi.zhang@huawei.com,
yangerkun@huawei.com, johnny.chenyi@huawei.com
Subject: [PATCH 09/10] blk-mq: remove blk_mq_tag_update_depth()
Date: Fri, 15 Aug 2025 16:02:15 +0800 [thread overview]
Message-ID: <20250815080216.410665-10-yukuai1@huaweicloud.com> (raw)
In-Reply-To: <20250815080216.410665-1-yukuai1@huaweicloud.com>
From: Yu Kuai <yukuai3@huawei.com>
This helper is not used now.
Signed-off-by: Yu Kuai <yukuai3@huawei.com>
---
block/blk-mq-tag.c | 31 -------------------------------
block/blk-mq.h | 2 --
2 files changed, 33 deletions(-)
diff --git a/block/blk-mq-tag.c b/block/blk-mq-tag.c
index 84a452e708e4..cbb93a653cef 100644
--- a/block/blk-mq-tag.c
+++ b/block/blk-mq-tag.c
@@ -583,37 +583,6 @@ void blk_mq_free_tags(struct blk_mq_tags *tags)
kfree(tags);
}
-int blk_mq_tag_update_depth(struct blk_mq_hw_ctx *hctx,
- struct blk_mq_tags **tagsptr, unsigned int tdepth)
-{
- struct blk_mq_tags *tags = *tagsptr;
-
- /*
- * If we are allowed to grow beyond the original size, allocate
- * a new set of tags before freeing the old one.
- */
- if (tdepth > tags->nr_tags) {
- struct blk_mq_tag_set *set = hctx->queue->tag_set;
- struct blk_mq_tags *new;
-
- new = blk_mq_alloc_map_and_rqs(set, hctx->queue_num, tdepth);
- if (!new)
- return -ENOMEM;
-
- blk_mq_free_map_and_rqs(set, *tagsptr, hctx->queue_num);
- *tagsptr = new;
- } else {
- /*
- * Don't need (or can't) update reserved tags here, they
- * remain static and should never need resizing.
- */
- sbitmap_queue_resize(&tags->bitmap_tags,
- tdepth - tags->nr_reserved_tags);
- }
-
- return 0;
-}
-
void blk_mq_tag_resize_shared_tags(struct blk_mq_tag_set *set, unsigned int size)
{
struct blk_mq_tags *tags = set->shared_tags;
diff --git a/block/blk-mq.h b/block/blk-mq.h
index 98740f9c204e..aaa006fe5076 100644
--- a/block/blk-mq.h
+++ b/block/blk-mq.h
@@ -183,8 +183,6 @@ unsigned long blk_mq_get_tags(struct blk_mq_alloc_data *data, int nr_tags,
void blk_mq_put_tag(struct blk_mq_tags *tags, struct blk_mq_ctx *ctx,
unsigned int tag);
void blk_mq_put_tags(struct blk_mq_tags *tags, int *tag_array, int nr_tags);
-int blk_mq_tag_update_depth(struct blk_mq_hw_ctx *hctx,
- struct blk_mq_tags **tags, unsigned int depth);
void blk_mq_tag_resize_shared_tags(struct blk_mq_tag_set *set,
unsigned int size);
void blk_mq_tag_update_sched_shared_tags(struct request_queue *q);
--
2.39.2
next prev parent reply other threads:[~2025-08-15 8:10 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-15 8:02 [PATCH 00/10] blk-mq: fix blk_mq_tags double free while nr_requests grown Yu Kuai
2025-08-15 8:02 ` [PATCH 01/10] blk-mq: remove useless checking from queue_requests_store() Yu Kuai
2025-08-15 8:02 ` [PATCH 02/10] blk-mq: remove useless checkings from blk_mq_update_nr_requests() Yu Kuai
2025-08-15 8:02 ` [PATCH 03/10] blk-mq: check invalid nr_requests in queue_requests_store() Yu Kuai
2025-08-15 8:02 ` [PATCH 04/10] blk-mq: serialize updating nr_requests with update_nr_hwq_lock Yu Kuai
2025-08-15 14:47 ` Ming Lei
2025-08-16 0:49 ` Yu Kuai
2025-08-16 2:23 ` Ming Lei
2025-08-15 8:02 ` [PATCH 05/10] blk-mq: cleanup shared tags case in blk_mq_update_nr_requests() Yu Kuai
2025-08-15 8:02 ` [PATCH 06/10] blk-mq: split bitmap grow and resize " Yu Kuai
2025-08-15 8:02 ` [PATCH 07/10] blk-mq-sched: add new parameter nr_requests in blk_mq_alloc_sched_tags() Yu Kuai
2025-08-15 8:02 ` [PATCH 08/10] blk-mq: fix blk_mq_tags double free while nr_requests grown Yu Kuai
2025-08-15 19:30 ` Nilay Shroff
2025-08-16 2:57 ` Yu Kuai
2025-08-16 4:05 ` Ming Lei
2025-08-16 8:05 ` 余快
2025-08-18 2:11 ` Ming Lei
2025-08-18 3:12 ` Ming Lei
2025-08-15 8:02 ` Yu Kuai [this message]
2025-08-15 8:02 ` [PATCH 10/10] blk-mq: fix stale nr_requests documentation Yu Kuai
2025-08-15 8:30 ` [PATCH 00/10] blk-mq: fix blk_mq_tags double free while nr_requests grown Ming Lei
2025-08-15 9:05 ` Yu Kuai
2025-08-15 14:20 ` Ming Lei
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=20250815080216.410665-10-yukuai1@huaweicloud.com \
--to=yukuai1@huaweicloud.com \
--cc=axboe@kernel.dk \
--cc=hare@suse.de \
--cc=johnny.chenyi@huawei.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ming.lei@redhat.com \
--cc=nilay@linux.ibm.com \
--cc=yangerkun@huawei.com \
--cc=yi.zhang@huawei.com \
--cc=yukuai3@huawei.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;
as well as URLs for NNTP newsgroup(s).