Skip to contentSkip to conversation

block: Move a misplaced comment in queue_wb_lat_store()

PATCH Applied Bart Van Assche 3 participants 3 messages Aug 25, 2025 Block layer

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 block: Move a misplaced comment in queue_wb_lat_store()

blk_mq_quiesce_queue() does not wait for pending I/O to finish. Freezing a queue waits for pending I/O to finish. Hence move the comment that refers to waiting for pending I/O above the call that freezes the request queue. This patch moves this comment back to the position where it was when this comment was introduced. See also commit c125311d96b1 ("blk-wbt: don't maintain inflight counts if disabled").

Cc Christoph Hellwig <[email protected]>
Cc Nilay Shroff <[email protected]>

---

Changes compared to v1: rebased on top of Jen's for-next branch.

 block/blk-sysfs.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
block/blk-sysfs.c +5 -5
index 4a7f1a349998..c94b8b6ab024 100644
@@ -620,6 +620,11 @@ static ssize_t queue_wb_lat_store(struct gendisk *disk, const char *page,
 	if (val < -1)
 		return -EINVAL;
 
+	/*
+	 * Ensure that the queue is idled, in case the latency update
+	 * ends up either enabling or disabling wbt completely. We can't
+	 * have IO inflight if that happens.
+	 */
 	memflags = blk_mq_freeze_queue(q);
 
 	rqos = wbt_rq_qos(q);
@@ -638,11 +643,6 @@ static ssize_t queue_wb_lat_store(struct gendisk *disk, const char *page,
 	if (wbt_get_min_lat(q) == val)
 		goto out;
 
-	/*
-	 * Ensure that the queue is idled, in case the latency update
-	 * ends up either enabling or disabling wbt completely. We can't
-	 * have IO inflight if that happens.
-	 */
 	blk_mq_quiesce_queue(q);
 
 	mutex_lock(&disk->rqos_state_mutex);
Reviewed-by on v2 1/1
#1 lore raw

Bart,

Quoted 6 lines

blk_mq_quiesce_queue() does not wait for pending I/O to finish. Freezing a queue waits for pending I/O to finish. Hence move the comment that refers to waiting for pending I/O above the call that freezes the request queue. This patch moves this comment back to the position where it was when this comment was introduced. See also commit c125311d96b1 ("blk-wbt: don't maintain inflight counts if disabled").

Signature · 1 line
Martin K. Petersen
maintainer Applied
#2 lore raw
In reply to Bart Van Assche
Quoted 8 lines · Bart Van Assche

blk_mq_quiesce_queue() does not wait for pending I/O to finish. Freezing a queue waits for pending I/O to finish. Hence move the comment that refers to waiting for pending I/O above the call that freezes the request queue. This patch moves this comment back to the position where it was when this comment was introduced. See also commit c125311d96b1 ("blk-wbt: don't maintain inflight counts if disabled").

[...]

Applied, thanks!

[1/1] block: Move a misplaced comment in queue_wb_lat_store()

      commit: f5d10e6915d80f7f4c4ed445a8b8ba4a5ee79318

Best regards,

Signature · 1 line
Jens Axboe