drm/amdgpu: fix scheduler timeout calc
Subsystems (2)
PATCH v3 1/1 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.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +10 -4
@@ -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,9 @@ 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 = + adev->sdma_timeout = + adev->video_timeout =msecs_to_jiffies (10000 ); adev->compute_timeout =MAX_SCHEDULE_TIMEOUT ;if (strnlen (input,AMDGPU_MAX_TIMEOUT_PARAM_LENTH )) {
@@ -1310,10 +1313,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++) {
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 1561713800-25552-1-git-send-email-flora.cui-5C7GfCeVMHo@public.gmane.org
Am 28.06.19 um 11:23 schrieb Cui, Flora:
Quoted 27 lines
scheduler timeout is in jiffies
v2: move timeout check toamdgpu_device_get_job_timeout_settingsafter parsing the value
v3: addlockup_timeoutparam check. 0: keep default value. negative:
infinity timeout.Change-Id I26708c163db943ff8d930dd81bcab4b4b9d84eb2Signed-off-by Flora Cui <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +2
-1@@ -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 );
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c int amdgpu_device_get_job_timeout_settings(struct amdgpu_device *adev) · line 1306
Quoted 7 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +3
-1@@ -1300,7 +1301,9 @@ 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 = + adev->sdma_timeout = + adev->video_timeout =msecs_to_jiffies (10000 );
I would write this as:
adev->gfx_timeout = msecs_to_jiffies(10000); adev->sdma_timeout = adev->video_timeout = adev->gfx_timeout;
Looks better than splitting this on multiple lines without any indentation.
Apart from that looks good to me,
Christian.
Quoted 9 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +0
-2adev->compute_timeout =MAX_SCHEDULE_TIMEOUT ;if (strnlen (input,AMDGPU_MAX_TIMEOUT_PARAM_LENTH )) {@@ -1310,10 +1313,13 @@ int amdgpu_device_get_job_timeout_settings(struct amdgpu_device *adev)if (ret)return ret; -/* Invalidate 0 and negative values */ -if (timeout <=0 ) {
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c int amdgpu_device_get_job_timeout_settings(struct amdgpu_device *adev) · line 1325
Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +5
-0+if (timeout ==0 ) { index++;continue ; + }else if (timeout <0 ) { + timeout =MAX_SCHEDULE_TIMEOUT ; + }else { + timeout =msecs_to_jiffies (timeout); }switch (index++) {
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx