linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] scsi: core: use eh_timeout to timeout start_unit command
@ 2021-11-10  1:23 brookxu
  2021-11-10  5:41 ` Christoph Hellwig
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: brookxu @ 2021-11-10  1:23 UTC (permalink / raw)
  To: jejb, martin.petersen; +Cc: hch, linux-scsi, linux-kernel

From: Chunguang Xu <brookxu@tencent.com>

In some abnormal scenarios, STU may timeout. The recovery
time of 30 seconds is relatively large. Now we need to modify
rq_timeout to adjust STU timeout value, but it will affect the
actual IO.

commit 9728c0814ecb ("[SCSI] make scsi_eh_try_stu use block
timeout") use rq_timeout to timeout the STU command, but after
commit 0816c9251a71 ("[SCSI] Allow error handling timeout to
be specified") eh_timeout will init to SCSI_DEFAULT_EH_TIMEOUT,
so it is more reasonable to use eh_timeout as the timeout value
of STU command. In this way, we can uniformly control recovery
time through eh_timeout.

Signed-off-by: Chunguang Xu <brookxu@tencent.com>
---
v2: Update commit log and fix some format issues.

 drivers/scsi/scsi_error.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c
index a531336..a665318 100644
--- a/drivers/scsi/scsi_error.c
+++ b/drivers/scsi/scsi_error.c
@@ -1404,7 +1404,8 @@ static int scsi_eh_try_stu(struct scsi_cmnd *scmd)
 		enum scsi_disposition rtn = NEEDS_RETRY;
 
 		for (i = 0; rtn == NEEDS_RETRY && i < 2; i++)
-			rtn = scsi_send_eh_cmnd(scmd, stu_command, 6, scmd->device->request_queue->rq_timeout, 0);
+			rtn = scsi_send_eh_cmnd(scmd, stu_command, 6,
+						scmd->device->eh_timeout, 0);
 
 		if (rtn == SUCCESS)
 			return 0;
-- 
1.8.3.1


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

* Re: [PATCH v2] scsi: core: use eh_timeout to timeout start_unit command
  2021-11-10  1:23 [PATCH v2] scsi: core: use eh_timeout to timeout start_unit command brookxu
@ 2021-11-10  5:41 ` Christoph Hellwig
  2021-11-16 12:01 ` Wu Bo
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Christoph Hellwig @ 2021-11-10  5:41 UTC (permalink / raw)
  To: brookxu; +Cc: jejb, martin.petersen, hch, linux-scsi, linux-kernel

Looks good,

Reviewed-by: Christoph Hellwig <hch@lst.de>

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

* Re: [PATCH v2] scsi: core: use eh_timeout to timeout start_unit command
  2021-11-10  1:23 [PATCH v2] scsi: core: use eh_timeout to timeout start_unit command brookxu
  2021-11-10  5:41 ` Christoph Hellwig
@ 2021-11-16 12:01 ` Wu Bo
  2021-11-19  3:16 ` Martin K. Petersen
  2021-11-23  3:48 ` Martin K. Petersen
  3 siblings, 0 replies; 5+ messages in thread
From: Wu Bo @ 2021-11-16 12:01 UTC (permalink / raw)
  To: brookxu, jejb, martin.petersen; +Cc: hch, linux-scsi, linux-kernel

On 2021/11/10 9:23, brookxu wrote:
> From: Chunguang Xu <brookxu@tencent.com>
> 
> In some abnormal scenarios, STU may timeout. The recovery
> time of 30 seconds is relatively large. Now we need to modify
> rq_timeout to adjust STU timeout value, but it will affect the
> actual IO.
> 
> commit 9728c0814ecb ("[SCSI] make scsi_eh_try_stu use block
> timeout") use rq_timeout to timeout the STU command, but after
> commit 0816c9251a71 ("[SCSI] Allow error handling timeout to
> be specified") eh_timeout will init to SCSI_DEFAULT_EH_TIMEOUT,
> so it is more reasonable to use eh_timeout as the timeout value
> of STU command. In this way, we can uniformly control recovery
> time through eh_timeout.
> 
> Signed-off-by: Chunguang Xu <brookxu@tencent.com>
> ---
> v2: Update commit log and fix some format issues.
> 
>   drivers/scsi/scsi_error.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c
> index a531336..a665318 100644
> --- a/drivers/scsi/scsi_error.c
> +++ b/drivers/scsi/scsi_error.c
> @@ -1404,7 +1404,8 @@ static int scsi_eh_try_stu(struct scsi_cmnd *scmd)
>   		enum scsi_disposition rtn = NEEDS_RETRY;
>   
>   		for (i = 0; rtn == NEEDS_RETRY && i < 2; i++)
> -			rtn = scsi_send_eh_cmnd(scmd, stu_command, 6, scmd->device->request_queue->rq_timeout, 0);
> +			rtn = scsi_send_eh_cmnd(scmd, stu_command, 6,
> +						scmd->device->eh_timeout, 0);
>   
>   		if (rtn == SUCCESS)
>   			return 0;
> 

Reviewed-by: Wu Bo <wubo40@huawei.com>

-- 
Wu Bo

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

* Re: [PATCH v2] scsi: core: use eh_timeout to timeout start_unit command
  2021-11-10  1:23 [PATCH v2] scsi: core: use eh_timeout to timeout start_unit command brookxu
  2021-11-10  5:41 ` Christoph Hellwig
  2021-11-16 12:01 ` Wu Bo
@ 2021-11-19  3:16 ` Martin K. Petersen
  2021-11-23  3:48 ` Martin K. Petersen
  3 siblings, 0 replies; 5+ messages in thread
From: Martin K. Petersen @ 2021-11-19  3:16 UTC (permalink / raw)
  To: brookxu; +Cc: jejb, martin.petersen, hch, linux-scsi, linux-kernel


> In some abnormal scenarios, STU may timeout. The recovery time of 30
> seconds is relatively large. Now we need to modify rq_timeout to
> adjust STU timeout value, but it will affect the actual IO.

Applied to 5.17/scsi-staging, thanks!

-- 
Martin K. Petersen	Oracle Linux Engineering

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

* Re: [PATCH v2] scsi: core: use eh_timeout to timeout start_unit command
  2021-11-10  1:23 [PATCH v2] scsi: core: use eh_timeout to timeout start_unit command brookxu
                   ` (2 preceding siblings ...)
  2021-11-19  3:16 ` Martin K. Petersen
@ 2021-11-23  3:48 ` Martin K. Petersen
  3 siblings, 0 replies; 5+ messages in thread
From: Martin K. Petersen @ 2021-11-23  3:48 UTC (permalink / raw)
  To: brookxu, jejb; +Cc: Martin K . Petersen, linux-scsi, linux-kernel, hch

On Wed, 10 Nov 2021 09:23:32 +0800, brookxu wrote:

> From: Chunguang Xu <brookxu@tencent.com>
> 
> In some abnormal scenarios, STU may timeout. The recovery
> time of 30 seconds is relatively large. Now we need to modify
> rq_timeout to adjust STU timeout value, but it will affect the
> actual IO.
> 
> [...]

Applied to 5.17/scsi-queue, thanks!

[1/1] scsi: core: use eh_timeout to timeout start_unit command
      https://git.kernel.org/mkp/scsi/c/adcc796b4f55

-- 
Martin K. Petersen	Oracle Linux Engineering

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

end of thread, other threads:[~2021-11-23  3:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-10  1:23 [PATCH v2] scsi: core: use eh_timeout to timeout start_unit command brookxu
2021-11-10  5:41 ` Christoph Hellwig
2021-11-16 12:01 ` Wu Bo
2021-11-19  3:16 ` Martin K. Petersen
2021-11-23  3:48 ` Martin K. Petersen

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