amd-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: "Christian König" <ckoenig.leichtzumerken-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Evan Quan <evan.quan-5C7GfCeVMHo@public.gmane.org>,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Cc: christian.koenig-5C7GfCeVMHo@public.gmane.org
Subject: Re: [PATCH] drm/amdgpu: treat negative lockup timeout as 'infinite timeout'
Date: Mon, 6 May 2019 13:26:27 +0200	[thread overview]
Message-ID: <03378dca-c0bb-443e-818a-3a01b69dcccb@gmail.com> (raw)
In-Reply-To: <20190505142353.30369-1-evan.quan-5C7GfCeVMHo@public.gmane.org>

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

  parent reply	other threads:[~2019-05-06 11:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
     [not found]     ` <03378dca-c0bb-443e-818a-3a01b69dcccb-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2019-05-07  1:48       ` Quan, Evan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=03378dca-c0bb-443e-818a-3a01b69dcccb@gmail.com \
    --to=ckoenig.leichtzumerken-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=christian.koenig-5C7GfCeVMHo@public.gmane.org \
    --cc=evan.quan-5C7GfCeVMHo@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).