diff mbox series

[v4,08/13] blk-mq: Don't clear driver tags own mapping

Message ID 1632472110-244938-9-git-send-email-john.garry@huawei.com (mailing list archive)
State New, archived
Headers show
Series blk-mq: Reduce static requests memory footprint for shared sbitmap | expand

Commit Message

John Garry Sept. 24, 2021, 8:28 a.m. UTC
Function blk_mq_clear_rq_mapping() is required to clear the sched tags
mappings in driver tags rqs[].

But there is no need for a driver tags to clear its own mapping, so skip
clearing the mapping in this scenario.

Signed-off-by: John Garry <john.garry@huawei.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
---
 block/blk-mq.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Ming Lei Sept. 26, 2021, 1:43 a.m. UTC | #1
On Fri, Sep 24, 2021 at 04:28:25PM +0800, John Garry wrote:
> Function blk_mq_clear_rq_mapping() is required to clear the sched tags
> mappings in driver tags rqs[].
> 
> But there is no need for a driver tags to clear its own mapping, so skip
> clearing the mapping in this scenario.
> 
> Signed-off-by: John Garry <john.garry@huawei.com>
> Reviewed-by: Hannes Reinecke <hare@suse.de>

Reviewed-by: Ming Lei <ming.lei@redhat.com>
diff mbox series

Patch

diff --git a/block/blk-mq.c b/block/blk-mq.c
index 4bae8afdfbe1..5229c5420b85 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -2308,6 +2308,10 @@  static void blk_mq_clear_rq_mapping(struct blk_mq_tags *drv_tags,
 	struct page *page;
 	unsigned long flags;
 
+	/* There is no need to clear a driver tags own mapping */
+	if (drv_tags == tags)
+		return;
+
 	list_for_each_entry(page, &tags->page_list, lru) {
 		unsigned long start = (unsigned long)page_address(page);
 		unsigned long end = start + order_to_size(page->private);