[1/4] blk-mq: update comment for blk_mq_quiesce_queue_nowait()

Message ID 489a9322eed1f95f8770752cc715084f1fa961d3.1667314759.git.nickyc975@zju.edu.cn
State New
Headers
Series some random cleanups for blk-mq.c |

Commit Message

Jinlong Chen Nov. 1, 2022, 3:11 p.m. UTC
  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 <nickyc975@zju.edu.cn>
---
 block/blk-mq.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
  

Comments

Christoph Hellwig Nov. 1, 2022, 5:27 p.m. UTC | #1
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.
  
Jinlong Chen Nov. 2, 2022, 1:44 a.m. UTC | #2
> 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
  

Patch

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)
 {