linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] block: Move a misplaced comment in queue_wb_lat_store()
@ 2025-08-22 20:01 Bart Van Assche
  2025-08-25  2:40 ` Nilay Shroff
  2025-08-25 13:48 ` Jens Axboe
  0 siblings, 2 replies; 4+ messages in thread
From: Bart Van Assche @ 2025-08-22 20:01 UTC (permalink / raw)
  To: Jens Axboe; +Cc: linux-block, Christoph Hellwig, Bart Van Assche, Nilay Shroff

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 <hch@lst.de>
Cc: Nilay Shroff <nilay@linux.ibm.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 block/blk-sysfs.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c
index 97dc047b2b0b..b82cd859a844 100644
--- a/block/blk-sysfs.c
+++ b/block/blk-sysfs.c
@@ -608,6 +608,11 @@ static ssize_t queue_wb_lat_store(struct gendisk *disk, const char *page,
 		return -EINVAL;
 
 	memflags = memalloc_noio_save();
+	/*
+	 * 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.
+	 */
 	ret = blk_mq_freeze_queue_nomemsave_timeout(q, q->rq_timeout);
 
 	rqos = wbt_rq_qos(q);
@@ -626,11 +631,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);

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] block: Move a misplaced comment in queue_wb_lat_store()
  2025-08-22 20:01 [PATCH] block: Move a misplaced comment in queue_wb_lat_store() Bart Van Assche
@ 2025-08-25  2:40 ` Nilay Shroff
  2025-08-25 13:48 ` Jens Axboe
  1 sibling, 0 replies; 4+ messages in thread
From: Nilay Shroff @ 2025-08-25  2:40 UTC (permalink / raw)
  To: Bart Van Assche, Jens Axboe; +Cc: linux-block, Christoph Hellwig



On 8/23/25 1:31 AM, Bart Van Assche wrote:
> 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 <hch@lst.de>
> Cc: Nilay Shroff <nilay@linux.ibm.com>
> Signed-off-by: Bart Van Assche <bvanassche@acm.org>

Looks good to me:
Reviewed-by: Nilay Shroff <nilay@linux.ibm.com>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] block: Move a misplaced comment in queue_wb_lat_store()
  2025-08-22 20:01 [PATCH] block: Move a misplaced comment in queue_wb_lat_store() Bart Van Assche
  2025-08-25  2:40 ` Nilay Shroff
@ 2025-08-25 13:48 ` Jens Axboe
  2025-08-25 15:08   ` Bart Van Assche
  1 sibling, 1 reply; 4+ messages in thread
From: Jens Axboe @ 2025-08-25 13:48 UTC (permalink / raw)
  To: Bart Van Assche
  Cc: linux-block, Christoph Hellwig, Bart Van Assche, Nilay Shroff

On Fri, Aug 22, 2025 at 2:02?PM Bart Van Assche <bvanassche@acm.org> wrote:
>
> 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").

Doesn't apply to the current tree, what is this against? In any case,
please resend.

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] block: Move a misplaced comment in queue_wb_lat_store()
  2025-08-25 13:48 ` Jens Axboe
@ 2025-08-25 15:08   ` Bart Van Assche
  0 siblings, 0 replies; 4+ messages in thread
From: Bart Van Assche @ 2025-08-25 15:08 UTC (permalink / raw)
  To: Jens Axboe; +Cc: linux-block, Christoph Hellwig, Nilay Shroff


On 8/25/25 6:48 AM, Jens Axboe wrote:
> On Fri, Aug 22, 2025 at 2:02?PM Bart Van Assche <bvanassche@acm.org> wrote:
>> 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").
> 
> Doesn't apply to the current tree, what is this against?

These patches are in my local tree and are causing the failure to apply:
"[PATCH 0/3] Fix a deadlock related to modifying queue attributes"
(https://lore.kernel.org/linux-block/20250702182430.3764163-1-bvanassche@acm.org/). 
I should have removed these from my local tree
before I posted this patch.

> In any case, please resend.

Sure, I will do that.

Thanks,

Bart.



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-08-25 15:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-22 20:01 [PATCH] block: Move a misplaced comment in queue_wb_lat_store() Bart Van Assche
2025-08-25  2:40 ` Nilay Shroff
2025-08-25 13:48 ` Jens Axboe
2025-08-25 15:08   ` Bart Van Assche

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).