diff mbox series

[3/4] blk-mq: delete superfluous check in iterate callback

Message ID 20230821073528.3469210-4-chengming.zhou@linux.dev (mailing list archive)
State New, archived
Headers show
Series blk-mq-tag: remove bt_for_each() | expand

Commit Message

Chengming Zhou Aug. 21, 2023, 7:35 a.m. UTC
From: Chengming Zhou <zhouchengming@bytedance.com>

The blk_mq_queue_tag_busy_iter() already has BT_TAG_ITER_STARTED flag
filter set, only started requests will be iterated over.

Signed-off-by: Chengming Zhou <zhouchengming@bytedance.com>
---
 block/blk-mq.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

Comments

Bart Van Assche Aug. 21, 2023, 9:29 p.m. UTC | #1
On 8/21/23 00:35, chengming.zhou@linux.dev wrote:
> From: Chengming Zhou <zhouchengming@bytedance.com>
> 
> The blk_mq_queue_tag_busy_iter() already has BT_TAG_ITER_STARTED flag
> filter set, only started requests will be iterated over.

Please consider changing the description of this patch into something like
the following: "The previous patch in this series changed the behavior of
blk_mq_queue_tag_busy_iter() from iterating over all allocated tags into
iterating over started requests only. Leave out the code from
blk_mq_rq_inflight() that became superfluous because of this change."

Thanks,

Bart.
diff mbox series

Patch

diff --git a/block/blk-mq.c b/block/blk-mq.c
index f14b8669ac69..0b03963e0854 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -1496,19 +1496,15 @@  EXPORT_SYMBOL(blk_mq_delay_kick_requeue_list);
 
 static bool blk_mq_rq_inflight(struct request *rq, void *priv)
 {
+	bool *busy = priv;
+
 	/*
 	 * If we find a request that isn't idle we know the queue is busy
 	 * as it's checked in the iter.
 	 * Return false to stop the iteration.
 	 */
-	if (blk_mq_request_started(rq)) {
-		bool *busy = priv;
-
-		*busy = true;
-		return false;
-	}
-
-	return true;
+	*busy = true;
+	return false;
 }
 
 bool blk_mq_queue_inflight(struct request_queue *q)