2022-11-01 15:40:25

by Jinlong Chen

[permalink] [raw]
Subject: [PATCH 1/4] blk-mq: update comment for blk_mq_quiesce_queue_nowait()

blk_mq_quiesce_queue_nowait() is now reasonably used by scsi_host_block()
to avoid calling synchronize_rcu() for each LUN. We should not consider to
remove it.

See commit f983622ae60516d634008c7b1ff9ffff4f7bb8ae ("scsi: core: Avoid
calling synchronize_rcu() for each device in scsi_host_block()")

Signed-off-by: Jinlong Chen <[email protected]>
---
block/blk-mq.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/block/blk-mq.c b/block/blk-mq.c
index 623e8a506539..7ceceea91b3b 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -237,9 +237,12 @@ void blk_mq_unfreeze_queue(struct request_queue *q)
}
EXPORT_SYMBOL_GPL(blk_mq_unfreeze_queue);

-/*
- * FIXME: replace the scsi_internal_device_*block_nowait() calls in the
- * mpt3sas driver such that this function can be removed.
+/**
+ * blk_mq_quiesce_queue_nowait() - start the quiesce of the queue
+ * @q: request queue.
+ *
+ * Note: synchronize_rcu() or synchronize_srcu(q->srcu) needs to
+ * be called to ensure the quiesce is done.
*/
void blk_mq_quiesce_queue_nowait(struct request_queue *q)
{
--
2.31.1



2022-11-01 17:35:13

by Christoph Hellwig

[permalink] [raw]
Subject: Re: [PATCH 1/4] blk-mq: update comment for blk_mq_quiesce_queue_nowait()

On Tue, Nov 01, 2022 at 11:11:34PM +0800, Jinlong Chen wrote:
> blk_mq_quiesce_queue_nowait() is now reasonably used by scsi_host_block()
> to avoid calling synchronize_rcu() for each LUN. We should not consider to
> remove it.

I strongly disagree about this being a reasonable use. What SCSI did
there is a horrible hack that should have never been merged. The
right thing to do is the per-tag_set quiesce that we've been working
on.

2022-11-02 02:02:29

by Jinlong Chen

[permalink] [raw]
Subject: Re: Re: [PATCH 1/4] blk-mq: update comment for blk_mq_quiesce_queue_nowait()

> On Tue, Nov 01, 2022 at 11:11:34PM +0800, Jinlong Chen wrote:
> > blk_mq_quiesce_queue_nowait() is now reasonably used by scsi_host_block()
> > to avoid calling synchronize_rcu() for each LUN. We should not consider to
> > remove it.
>
> I strongly disagree about this being a reasonable use. What SCSI did
> there is a horrible hack that should have never been merged. The
> right thing to do is the per-tag_set quiesce that we've been working
> on.

Ok, I guess I need to read the per-tag_set quiesce patch series.

Thanks!
Jinlong Chen