[PATCH v5 08/14] blk-mq: Don't clear driver tags own mapping

From
John Garry <hidden>
Date
2021-10-05 10:29:28
Also in
linux-scsi, lkml
Reply to
John Garry, 2021-10-05
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 <redacted>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Ming Lei <redacted>
---
 block/blk-mq.c | 4 ++++
 1 file changed, 4 insertions(+)
diff --git a/block/blk-mq.c b/block/blk-mq.c
index 1bee153e6b7f..158ee7dbbd76 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -2310,6 +2310,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);
-- 
2.26.2
Thread (23 messages) 23 messages, 4 authors, last reply 2021-10-08
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help