public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: chengming.zhou@linux.dev
To: axboe@kernel.dk, ming.lei@redhat.com, bvanassche@acm.org, hch@lst.de
Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
	zhouchengming@bytedance.com
Subject: [PATCH v2 4/6] blk-mq: delete superfluous check in iterate callback
Date: Wed, 23 Aug 2023 17:04:39 +0800	[thread overview]
Message-ID: <20230823090441.3986631-5-chengming.zhou@linux.dev> (raw)
In-Reply-To: <20230823090441.3986631-1-chengming.zhou@linux.dev>

From: Chengming Zhou <zhouchengming@bytedance.com>

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.

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

diff --git a/block/blk-mq.c b/block/blk-mq.c
index 953f08354c8c..f1bafbae0a61 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -1516,19 +1516,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)
-- 
2.41.0


  parent reply	other threads:[~2023-08-23  9:26 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-23  9:04 [PATCH v2 0/6] blk-mq-tag: remove bt_for_each() chengming.zhou
2023-08-23  9:04 ` [PATCH v2 1/6] blk-mq-tag: support queue filter in bt_tags_iter() chengming.zhou
2023-08-23 14:28   ` Bart Van Assche
2023-08-23  9:04 ` [PATCH v2 2/6] blk-mq-tag: introduce __blk_mq_tagset_busy_iter() chengming.zhou
2023-08-23 14:29   ` Bart Van Assche
2023-08-23  9:04 ` [PATCH v2 3/6] blk-mq-tag: remove bt_for_each() chengming.zhou
2023-08-23 14:39   ` Bart Van Assche
2023-08-23  9:04 ` chengming.zhou [this message]
2023-08-23 14:40   ` [PATCH v2 4/6] blk-mq: delete superfluous check in iterate callback Bart Van Assche
2023-08-23  9:04 ` [PATCH v2 5/6] blk-mq-tag: fix functions documentation chengming.zhou
2023-08-23 14:40   ` Bart Van Assche
2023-08-23  9:04 ` [PATCH v2 6/6] blk-mq-tag: fix blk_mq_queue_tag_busy_iter() documentation chengming.zhou
2023-08-23 14:46   ` Bart Van Assche
2023-08-23 15:03     ` Chengming Zhou

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=20230823090441.3986631-5-chengming.zhou@linux.dev \
    --to=chengming.zhou@linux.dev \
    --cc=axboe@kernel.dk \
    --cc=bvanassche@acm.org \
    --cc=hch@lst.de \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ming.lei@redhat.com \
    --cc=zhouchengming@bytedance.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