AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Christian König" <ckoenig.leichtzumerken-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: "Xu, Feifei" <Feifei.Xu-5C7GfCeVMHo@public.gmane.org>,
	"Cui, Flora" <Flora.Cui-5C7GfCeVMHo@public.gmane.org>,
	"amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org"
	<amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>
Subject: Re: [PATCH v4] drm/amdgpu: fix scheduler timeout calc
Date: Sun, 14 Jul 2019 09:23:23 +0200	[thread overview]
Message-ID: <6bbd4268-2d5d-fa98-6569-412b918b1a9f@gmail.com> (raw)
In-Reply-To: <CH2PR12MB3767D1E71B22B99D41ECAB20FEF50-rV3HgkLYx2Vb0rI3ZRjBIAdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>

Reviewed-by: Christian König <christian.koenig@amd.com>

Sorry for the delay, I've been on vacation for two weeks.

Christian.

Am 05.07.19 um 07:37 schrieb Xu, Feifei:
> Reviewed-by: Feifei.Xu@amd.com
>
> -----Original Message-----
> From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of Cui, Flora
> Sent: Monday, July 1, 2019 11:37 AM
> To: amd-gfx@lists.freedesktop.org
> Cc: Cui, Flora <Flora.Cui@amd.com>
> Subject: [PATCH v4] drm/amdgpu: fix scheduler timeout calc
>
> scheduler timeout is in jiffies
> v2: move timeout check to amdgpu_device_get_job_timeout_settings after parsing the value
> v3: add lockup_timeout param check. 0: keep default value. negative:
> infinity timeout.
> v4: refactor codes.
>
> Change-Id: I26708c163db943ff8d930dd81bcab4b4b9d84eb2
> Signed-off-by: Flora Cui <flora.cui@amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 13 +++++++++----
>   1 file changed, 9 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> index e74a175..e448f8e 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> @@ -245,7 +245,8 @@ module_param_named(msi, amdgpu_msi, int, 0444);
>    * 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.
>    */
> -MODULE_PARM_DESC(lockup_timeout, "GPU lockup timeout in ms (default: 10000 for non-compute jobs and no timeout for compute jobs), "
> +MODULE_PARM_DESC(lockup_timeout, "GPU lockup timeout in ms (default: 10000 for non-compute jobs and infinity timeout for compute jobs."
> +		" 0: keep default value. negative: infinity timeout), "
>   		"format is [Non-Compute] or [GFX,Compute,SDMA,Video]");  module_param_string(lockup_timeout, amdgpu_lockup_timeout, sizeof(amdgpu_lockup_timeout), 0444);
>   
> @@ -1300,7 +1301,8 @@ int amdgpu_device_get_job_timeout_settings(struct amdgpu_device *adev)
>   	 * By default timeout for non compute jobs is 10000.
>   	 * And there is no timeout enforced on compute jobs.
>   	 */
> -	adev->gfx_timeout = adev->sdma_timeout = adev->video_timeout = 10000;
> +	adev->gfx_timeout = msecs_to_jiffies(10000);
> +	adev->sdma_timeout = adev->video_timeout = adev->gfx_timeout;
>   	adev->compute_timeout = MAX_SCHEDULE_TIMEOUT;
>   
>   	if (strnlen(input, AMDGPU_MAX_TIMEOUT_PARAM_LENTH)) { @@ -1310,10 +1312,13 @@ int amdgpu_device_get_job_timeout_settings(struct amdgpu_device *adev)
>   			if (ret)
>   				return ret;
>   
> -			/* Invalidate 0 and negative values */
> -			if (timeout <= 0) {
> +			if (timeout == 0) {
>   				index++;
>   				continue;
> +			} else if (timeout < 0) {
> +				timeout = MAX_SCHEDULE_TIMEOUT;
> +			} else {
> +				timeout = msecs_to_jiffies(timeout);
>   			}
>   
>   			switch (index++) {
> --
> 2.7.4
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

      parent reply	other threads:[~2019-07-14  7:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-01  3:37 [PATCH v4] drm/amdgpu: fix scheduler timeout calc Cui, Flora
     [not found] ` <1561952220-5526-1-git-send-email-flora.cui-5C7GfCeVMHo@public.gmane.org>
2019-07-04  3:08   ` Cui, Flora
     [not found]     ` <MN2PR12MB331205B8AD6A1389A7519A04FAFA0-rweVpJHSKToE250A+C2e2AdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2019-07-05  5:35       ` Cui, Flora
2019-07-05  5:37   ` Xu, Feifei
     [not found]     ` <CH2PR12MB3767D1E71B22B99D41ECAB20FEF50-rV3HgkLYx2Vb0rI3ZRjBIAdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2019-07-14  7:23       ` Christian König [this message]

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=6bbd4268-2d5d-fa98-6569-412b918b1a9f@gmail.com \
    --to=ckoenig.leichtzumerken-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=Feifei.Xu-5C7GfCeVMHo@public.gmane.org \
    --cc=Flora.Cui-5C7GfCeVMHo@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=christian.koenig-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