drm/amdgpu: fix scheduler timeout calc
Subsystems (2)
PATCH v2 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
--- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +5 -2
@@ -1300,7 +1300,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 )) {
@@ -1314,7 +1316,8 @@ int amdgpu_device_get_job_timeout_settings(struct amdgpu_device *adev)if (timeout <=0 ) { index++;continue ; - } + }else + timeout =msecs_to_jiffies (timeout);switch (index++) {case 0 :
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): 1561629780-21649-1-git-send-email-flora.cui-5C7GfCeVMHo@public.gmane.org
Am 27.06.19 um 12:03 schrieb Cui, Flora:
Quoted 15 lines
scheduler timeout is in jiffies
v2: move timeout check toamdgpu_device_get_job_timeout_settingsafter parsing the valueChange-Id I26708c163db943ff8d930dd81bcab4b4b9d84eb2Signed-off-by Flora Cui <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +0
-0
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c int amdgpu_device_get_job_timeout_settings(struct amdgpu_device *adev) · line 1305
Quoted 7 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +3
-1@@ -1300,7 +1300,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 );
Of hand that looks very odd to me. This is not a macro so why the \ here?
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c int amdgpu_device_get_job_timeout_settings(struct amdgpu_device *adev) · line 1320
Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +2
-1adev->compute_timeout =MAX_SCHEDULE_TIMEOUT ;if (strnlen (input,AMDGPU_MAX_TIMEOUT_PARAM_LENTH )) {@@ -1314,7 +1316,8 @@ int amdgpu_device_get_job_timeout_settings(struct amdgpu_device *adev)if (timeout <=0 ) { index++;continue ; - } + }else + timeout =msecs_to_jiffies (timeout);
You can actually remove the "if (timeout <= 0)" as well, msecs_to_jiffies will do the right thing for negative values.
Christian.
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c int amdgpu_device_get_job_timeout_settings(struct amdgpu_device *adev) · line 1323
Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +0
-0switch (index++) {case 0 :
_______________________________________________
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): 379c7272-a581-d3f2-582c-fbb92d59f00f-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Quoted 20 lines · Christian König
Am 27.06.19 um 12:03 schrieb Cui, Flora:
Quoted 19 lines
scheduler timeout is in jiffies
v2: move timeout check toamdgpu_device_get_job_timeout_settingsafter parsing the valueChange-Id I26708c163db943ff8d930dd81bcab4b4b9d84eb2Signed-off-by Flora Cui <[email protected]>---
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c| 7 +++++--1 file changed, 5 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +0
-0@@ -1300,7 +1300,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.
Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c int amdgpu_device_get_job_timeout_settings(struct amdgpu_device *adev) · line 1305
Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +3
-1*/ - adev->gfx_timeout = adev->sdma_timeout = adev->video_timeout =10000 ; + adev->gfx_timeout = \ + adev->sdma_timeout = \ + adev->video_timeout = msecs_to_jiffies(10000);Of hand that looks very odd to me. This is not a macro so why the \ here?
will update in v3
Quoted 14 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c int · line 1321
Quoted 11 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +0
-0adev->compute_timeout = MAX_SCHEDULE_TIMEOUT;if (
strnlen(input, AMDGPU_MAX_TIMEOUT_PARAM_LENTH)) {drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +2
-1@@ -1314,7 +1316,8 @@ int amdgpu_device_get_job_timeout_settings(struct amdgpu_device *adev) if (timeout <= 0) { index++; continue; - } + } else + timeout = msecs_to_jiffies(timeout);You can actually remove the "if (timeout <= 0)" as well,
msecs_to_jiffieswill do the right thing for negative values.
IMHO check for timeout==0 is still needed. msecs_to_jiffies() would return 0 and that's not desired for scheduler timer.
Quoted 6 lines
Christian.
Quoted 2 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +0
-0switch (index++) {case 0:
_______________________________________________
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): 86b459d5-8c11-c68c-9b14-0c5adf103a9e-5C7GfCeVMHo@public.gmane.org
Am 28.06.19 um 07:32 schrieb Cui, Flora:
Quoted 41 lines · Christian König
Quoted 11 lines
Am 27.06.19 um 12:03 schrieb Cui, Flora:
Quoted 10 lines
scheduler timeout is in jiffies
v2: move timeout check toamdgpu_device_get_job_timeout_settingsafter parsing the valueChange-Id I26708c163db943ff8d930dd81bcab4b4b9d84eb2Signed-off-by Flora Cui <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)Quoted 16 lines
Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +0
-0drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c int · line 1307
Quoted 9 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +3
-1@@ -1300,7 +1300,9 @@ intamdgpu_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);Of hand that looks very odd to me. This is not a macro so why the \ here?
will update in v3
Quoted 4 lines
Quoted 4 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +0
-0adev->compute_timeout = MAX_SCHEDULE_TIMEOUT;if (
strnlen(input, AMDGPU_MAX_TIMEOUT_PARAM_LENTH)) {drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +0
-0@@ -1314,7 +1316,8 @@ int amdgpu_device_get_job_timeout_settings(struct amdgpu_device *adev)Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c int amdgpu_device_get_job_timeout_settings(struct amdgpu_device *adev) · line 1320
Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +2
-1if (timeout <= 0) { index++; continue; - } + } else + timeout = msecs_to_jiffies(timeout);You can actually remove the "if (timeout <= 0)" as well,
msecs_to_jiffieswill do the right thing for negative values.
Quoted 2 lines
IMHO check for timeout==0 is still needed.
msecs_to_jiffies()would return 0 and that's not desired for scheduler timer.
Good point, so 0 would use the default value and negative values would use infinity.
That sounds like a good solution to me,
Christian.
Quoted 4 lines
Quoted 4 lines
Christian.
Quoted 2 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +0
-0switch (index++) { case 0:
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx