diff mbox series

[v4,4/4] Revert "scsi: core: run queue if SCSI device queue isn't ready and queue is idle"

Message ID 20200408080255.v4.4.I630e6ca4cdcf9ab13ea899274745f9e3174eb12b@changeid (mailing list archive)
State Superseded
Headers show
Series blk-mq: Fix two causes of IO stalls found in reboot testing | expand

Commit Message

Doug Anderson April 8, 2020, 3:04 p.m. UTC
This reverts commit 7e70aa789d4a0c89dbfbd2c8a974a4df717475ec.

Now that we have the patches ("blk-mq: In blk_mq_dispatch_rq_list()
"no budget" is a reason to kick") and ("blk-mq: Rerun dispatching in
the case of budget contention") we should no longer need the fix in
the SCSI code.  Revert it, resolving conflicts with other patches that
have touched this code.

With this revert (and the two new patches) I can run the script that
was in commit 7e70aa789d4a ("scsi: core: run queue if SCSI device
queue isn't ready and queue is idle") in a loop with no failure.  If I
do this revert without the two new patches I can easily get a failure.

Signed-off-by: Douglas Anderson <dianders@chromium.org>
---
I don't know for sure that we can revert this patch, but in the very
least the original test case now passes.  If there is any question
about this, we can just drop this patch.

Changes in v4: None
Changes in v3:
- ("Revert "scsi: core: run queue...") new for v3.

Changes in v2: None

 drivers/scsi/scsi_lib.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

Comments

Ming Lei April 9, 2020, 1:24 a.m. UTC | #1
On Wed, Apr 08, 2020 at 08:04:02AM -0700, Douglas Anderson wrote:
> This reverts commit 7e70aa789d4a0c89dbfbd2c8a974a4df717475ec.
> 
> Now that we have the patches ("blk-mq: In blk_mq_dispatch_rq_list()
> "no budget" is a reason to kick") and ("blk-mq: Rerun dispatching in
> the case of budget contention") we should no longer need the fix in
> the SCSI code.  Revert it, resolving conflicts with other patches that
> have touched this code.
> 
> With this revert (and the two new patches) I can run the script that
> was in commit 7e70aa789d4a ("scsi: core: run queue if SCSI device
> queue isn't ready and queue is idle") in a loop with no failure.  If I
> do this revert without the two new patches I can easily get a failure.
> 
> Signed-off-by: Douglas Anderson <dianders@chromium.org>
> ---
> I don't know for sure that we can revert this patch, but in the very
> least the original test case now passes.  If there is any question
> about this, we can just drop this patch.

I think it is safe to revert this patch.

This patch should have been one workaround in case of dispatch from hctx->dispatch,
since there is one race. When dispatch from scheduler queue, any
IO completion will re-run all hctxs, so no need to do the trick.

Reviewed-by: Ming Lei <ming.lei@redhat.com>


thanks,
Ming
Martin K. Petersen April 13, 2020, 5:51 p.m. UTC | #2
Douglas,

> This reverts commit 7e70aa789d4a0c89dbfbd2c8a974a4df717475ec.
>
> Now that we have the patches ("blk-mq: In blk_mq_dispatch_rq_list()
> "no budget" is a reason to kick") and ("blk-mq: Rerun dispatching in
> the case of budget contention") we should no longer need the fix in
> the SCSI code.  Revert it, resolving conflicts with other patches that
> have touched this code.
>
> With this revert (and the two new patches) I can run the script that
> was in commit 7e70aa789d4a ("scsi: core: run queue if SCSI device
> queue isn't ready and queue is idle") in a loop with no failure.  If I
> do this revert without the two new patches I can easily get a failure.
>
> Signed-off-by: Douglas Anderson <dianders@chromium.org>

Looks good to me, never really liked the original commit.

Acked-by: Martin K. Petersen <martin.petersen@oracle.com>
diff mbox series

Patch

diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index 610ee41fa54c..b9e28ea76cc0 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -1632,12 +1632,7 @@  static bool scsi_mq_get_budget(struct blk_mq_hw_ctx *hctx)
 	struct request_queue *q = hctx->queue;
 	struct scsi_device *sdev = q->queuedata;
 
-	if (scsi_dev_queue_ready(q, sdev))
-		return true;
-
-	if (atomic_read(&sdev->device_busy) == 0 && !scsi_device_blocked(sdev))
-		blk_mq_delay_run_hw_queue(hctx, SCSI_QUEUE_DELAY);
-	return false;
+	return scsi_dev_queue_ready(q, sdev);
 }
 
 static blk_status_t scsi_queue_rq(struct blk_mq_hw_ctx *hctx,