Re: [PATCH v3 09/11] scsi: scsi_debug: Use scsi_host_busy() in delay_store() and ndelay_store()

From: Douglas Gilbert
Date: Mon Apr 03 2023 - 01:21:48 EST


On 2023-03-27 03:43, John Garry wrote:
The functions to update ndelay and delay value first check whether we have
any in-flight IO for any host. It does this by checking if any tag is used
in the global submit queues.

We can achieve the same by setting the host as blocked and then ensuring
that we have no in-flight commands with scsi_host_busy().

Note that scsi_host_busy() checks SCMD_STATE_INFLIGHT flag, which is only
set per command after we ensure that the host is not blocked, i.e. we
see more commands active after the check for scsi_host_busy() returns 0.

Signed-off-by: John Garry <john.g.garry@xxxxxxxxxx>
Acked-by: Douglas Gilbert <dgilbert@xxxxxxxxxxxx>

Thanks.