All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu: treat negative lockup timeout as 'infinite timeout'
@ 2019-05-05 14:23 Evan Quan
       [not found] ` <20190505142353.30369-1-evan.quan-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Evan Quan @ 2019-05-05 14:23 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
  Cc: Evan Quan, christian.koenig-5C7GfCeVMHo

Negative lockup timeout is valid and will be treated as
'infinite timeout'.

Change-Id: I0d8387956a9c744073c0281ef2e1a547d4f16dec
Signed-off-by: Evan Quan <evan.quan@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
index 5b03e17e6e06..4d6dff6855f8 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
@@ -233,13 +233,14 @@ module_param_named(msi, amdgpu_msi, int, 0444);
  * Set GPU scheduler timeout value in ms.
  *
  * The format can be [Non-Compute] or [GFX,Compute,SDMA,Video]. That is there can be one or
- * multiple values specified. 0 and negative values are invalidated. They will be adjusted
- * to default timeout.
+ * multiple values specified.
  *  - With one value specified, the setting will apply to all non-compute jobs.
  *  - With multiple values specified, the first one will be for GFX. The second one is for Compute.
  *    And the third and fourth ones are for SDMA and Video.
  * By default(with no lockup_timeout settings), the timeout for all non-compute(GFX, SDMA and Video)
  * jobs is 10000. And there is no timeout enforced on compute jobs.
+ * Value 0 is invalidated, will be adjusted to default timeout settings.
+ * Negative values mean 'infinite timeout' (MAX_JIFFY_OFFSET).
  */
 MODULE_PARM_DESC(lockup_timeout, "GPU lockup timeout in ms (default: 10000 for non-compute jobs and no timeout for compute jobs), "
 		"format is [Non-Compute] or [GFX,Compute,SDMA,Video]");
@@ -1248,11 +1249,16 @@ int amdgpu_device_get_job_timeout_settings(struct amdgpu_device *adev)
 			if (ret)
 				return ret;
 
-			/* Invalidate 0 and negative values */
-			if (timeout <= 0) {
+			/*
+			 * Value 0 will be adjusted to default timeout settings.
+			 * Negative values mean 'infinite timeout' (MAX_JIFFY_OFFSET).
+			 */
+			if (!timeout) {
 				index++;
 				continue;
 			}
+			if (timeout < 0)
+				timeout = MAX_JIFFY_OFFSET;
 
 			switch (index++) {
 			case 0:
-- 
2.21.0

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* Re: [PATCH] drm/amdgpu: treat negative lockup timeout as 'infinite timeout'
       [not found] ` <20190505142353.30369-1-evan.quan-5C7GfCeVMHo@public.gmane.org>
@ 2019-05-06 11:26   ` Christian König
       [not found]     ` <03378dca-c0bb-443e-818a-3a01b69dcccb-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Christian König @ 2019-05-06 11:26 UTC (permalink / raw)
  To: Evan Quan, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
  Cc: christian.koenig-5C7GfCeVMHo

Am 05.05.19 um 16:23 schrieb Evan Quan:
> Negative lockup timeout is valid and will be treated as
> 'infinite timeout'.
>
> Change-Id: I0d8387956a9c744073c0281ef2e1a547d4f16dec
> Signed-off-by: Evan Quan <evan.quan@amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 14 ++++++++++----
>   1 file changed, 10 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> index 5b03e17e6e06..4d6dff6855f8 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> @@ -233,13 +233,14 @@ module_param_named(msi, amdgpu_msi, int, 0444);
>    * Set GPU scheduler timeout value in ms.
>    *
>    * The format can be [Non-Compute] or [GFX,Compute,SDMA,Video]. That is there can be one or
> - * multiple values specified. 0 and negative values are invalidated. They will be adjusted
> - * to default timeout.
> + * multiple values specified.
>    *  - With one value specified, the setting will apply to all non-compute jobs.
>    *  - With multiple values specified, the first one will be for GFX. The second one is for Compute.
>    *    And the third and fourth ones are for SDMA and Video.
>    * By default(with no lockup_timeout settings), the timeout for all non-compute(GFX, SDMA and Video)
>    * jobs is 10000. And there is no timeout enforced on compute jobs.
> + * Value 0 is invalidated, will be adjusted to default timeout settings.
> + * Negative values mean 'infinite timeout' (MAX_JIFFY_OFFSET).
>    */
>   MODULE_PARM_DESC(lockup_timeout, "GPU lockup timeout in ms (default: 10000 for non-compute jobs and no timeout for compute jobs), "
>   		"format is [Non-Compute] or [GFX,Compute,SDMA,Video]");
> @@ -1248,11 +1249,16 @@ int amdgpu_device_get_job_timeout_settings(struct amdgpu_device *adev)
>   			if (ret)
>   				return ret;
>   
> -			/* Invalidate 0 and negative values */
> -			if (timeout <= 0) {
> +			/*
> +			 * Value 0 will be adjusted to default timeout settings.
> +			 * Negative values mean 'infinite timeout' (MAX_JIFFY_OFFSET).
> +			 */
> +			if (!timeout) {
>   				index++;
>   				continue;
>   			}
> +			if (timeout < 0)
> +				timeout = MAX_JIFFY_OFFSET;

This is superfluous and maybe even harmful, msecs_to_jiffies() should 
take care of this conversion.

Maybe even convert the values directly here.

Christian.

>   
>   			switch (index++) {
>   			case 0:

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* RE: [PATCH] drm/amdgpu: treat negative lockup timeout as 'infinite timeout'
       [not found]     ` <03378dca-c0bb-443e-818a-3a01b69dcccb-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2019-05-07  1:48       ` Quan, Evan
  0 siblings, 0 replies; 3+ messages in thread
From: Quan, Evan @ 2019-05-07  1:48 UTC (permalink / raw)
  To: Koenig, Christian,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org

Thanks! Just sent out a V2 version with this addressed.

> -----Original Message-----
> From: Christian König <ckoenig.leichtzumerken@gmail.com>
> Sent: 2019年5月6日 19:26
> To: Quan, Evan <Evan.Quan@amd.com>; amd-gfx@lists.freedesktop.org
> Cc: Koenig, Christian <Christian.Koenig@amd.com>
> Subject: Re: [PATCH] drm/amdgpu: treat negative lockup timeout as 'infinite
> timeout'
> 
> [CAUTION: External Email]
> 
> Am 05.05.19 um 16:23 schrieb Evan Quan:
> > Negative lockup timeout is valid and will be treated as 'infinite
> > timeout'.
> >
> > Change-Id: I0d8387956a9c744073c0281ef2e1a547d4f16dec
> > Signed-off-by: Evan Quan <evan.quan@amd.com>
> > ---
> >   drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 14 ++++++++++----
> >   1 file changed, 10 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> > b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> > index 5b03e17e6e06..4d6dff6855f8 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> > @@ -233,13 +233,14 @@ module_param_named(msi, amdgpu_msi, int,
> 0444);
> >    * Set GPU scheduler timeout value in ms.
> >    *
> >    * The format can be [Non-Compute] or [GFX,Compute,SDMA,Video].
> That
> > is there can be one or
> > - * multiple values specified. 0 and negative values are invalidated.
> > They will be adjusted
> > - * to default timeout.
> > + * multiple values specified.
> >    *  - With one value specified, the setting will apply to all non-compute
> jobs.
> >    *  - With multiple values specified, the first one will be for GFX. The
> second one is for Compute.
> >    *    And the third and fourth ones are for SDMA and Video.
> >    * By default(with no lockup_timeout settings), the timeout for all non-
> compute(GFX, SDMA and Video)
> >    * jobs is 10000. And there is no timeout enforced on compute jobs.
> > + * Value 0 is invalidated, will be adjusted to default timeout settings.
> > + * Negative values mean 'infinite timeout' (MAX_JIFFY_OFFSET).
> >    */
> >   MODULE_PARM_DESC(lockup_timeout, "GPU lockup timeout in ms
> (default: 10000 for non-compute jobs and no timeout for compute jobs), "
> >               "format is [Non-Compute] or [GFX,Compute,SDMA,Video]");
> > @@ -1248,11 +1249,16 @@ int
> amdgpu_device_get_job_timeout_settings(struct amdgpu_device *adev)
> >                       if (ret)
> >                               return ret;
> >
> > -                     /* Invalidate 0 and negative values */
> > -                     if (timeout <= 0) {
> > +                     /*
> > +                      * Value 0 will be adjusted to default timeout settings.
> > +                      * Negative values mean 'infinite timeout' (MAX_JIFFY_OFFSET).
> > +                      */
> > +                     if (!timeout) {
> >                               index++;
> >                               continue;
> >                       }
> > +                     if (timeout < 0)
> > +                             timeout = MAX_JIFFY_OFFSET;
> 
> This is superfluous and maybe even harmful, msecs_to_jiffies() should take
> care of this conversion.
> 
> Maybe even convert the values directly here.
> 
> Christian.
> 
> >
> >                       switch (index++) {
> >                       case 0:

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

end of thread, other threads:[~2019-05-07  1:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-05 14:23 [PATCH] drm/amdgpu: treat negative lockup timeout as 'infinite timeout' Evan Quan
     [not found] ` <20190505142353.30369-1-evan.quan-5C7GfCeVMHo@public.gmane.org>
2019-05-06 11:26   ` Christian König
     [not found]     ` <03378dca-c0bb-443e-818a-3a01b69dcccb-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2019-05-07  1:48       ` Quan, Evan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.