drm/amdgpu: avoid duplicated tmo report on same job
Subsystems (3)
PATCH 1/1 drm/amdgpu: avoid duplicated tmo report on same job
--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 3 +-- drivers/gpu/drm/amd/amdgpu/amdgpu_job.c | 12 +++++++++++- include/drm/gpu_scheduler.h | 1 + 3 files changed, 13 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +1 -2
@@ -3356,8 +3356,7 @@ bool amdgpu_device_should_recover_gpu(struct amdgpu_device *adev)return true; disabled: -DRM_INFO ("GPU recovery disabled.\n" ); -return false; +return false; }
drivers/gpu/drm/amd/amdgpu/amdgpu_job.c +11 -1
@@ -33,6 +33,7 @@ static void amdgpu_job_timedout(struct drm_sched_job *s_job)struct amdgpu_ring *ring =to_amdgpu_ring (s_job->sched);struct amdgpu_job *job =to_amdgpu_job (s_job);struct amdgpu_task_info ti; +bool recover;memset (&ti,0 ,sizeof (struct amdgpu_task_info ));
@@ -42,6 +43,11 @@ static void amdgpu_job_timedout(struct drm_sched_job *s_job)return ; } + recover =amdgpu_device_should_recover_gpu (ring->adev); +if (s_job->sched->last_tmo_id == s_job->id) + goto skip_report; + + s_job->sched->last_tmo_id = s_job->id;amdgpu_vm_get_task_info (ring->adev, job->pasid, &ti); DRM_ERROR("ring %s timeout, signaled seq=%u, emitted seq=%u\n", job->base.sched->name, atomic_read(&ring->fence_drv.last_seq),
@@ -49,7 +55,11 @@ static void amdgpu_job_timedout(struct drm_sched_job *s_job)DRM_ERROR ("Process information: process %s pid %d thread %s pid %d\n" , ti.process_name, ti.tgid, ti.task_name, ti.pid); -if (amdgpu_device_should_recover_gpu (ring->adev)) +if (!recover) +DRM_INFO ("GPU recovery disabled.\n" ); + +skip_report: +if (recover)amdgpu_device_gpu_recover (ring->adev, job); }
include/drm/gpu_scheduler.h +1 -0
@@ -282,6 +282,7 @@ struct drm_gpu_scheduler {int hang_limit;atomic_t num_jobs;bool ready; +uint64_t last_tmo_id; }; int drm_sched_init(struct drm_gpu_scheduler *sched,
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): 1557472668-12462-1-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org
Hi Christian,
What about this one, no timer logic change on scheduler part, only the duplicated tmo report is muted
/Monk
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Monk Liu
Sent: Friday, May 10, 2019 3:18 PM
To: [email protected]
Cc: Liu, Monk <[email protected]>
Subject: [PATCH] drm/amdgpu: avoid duplicated tmo report on same job
[CAUTION: External Email]
--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 3 +-- drivers/gpu/drm/amd/amdgpu/amdgpu_job.c | 12 +++++++++++- include/drm/gpu_scheduler.h | 1 + 3 files changed, 13 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +1 -2
@@ -3356,8 +3356,7 @@ bool amdgpu_device_should_recover_gpu(struct amdgpu_device *adev)return true; disabled: -DRM_INFO ("GPU recovery disabled.\n" ); -return false; +return false; }
drivers/gpu/drm/amd/amdgpu/amdgpu_job.c +11 -1
@@ -33,6 +33,7 @@ static void amdgpu_job_timedout(struct drm_sched_job *s_job)struct amdgpu_ring *ring =to_amdgpu_ring (s_job->sched);struct amdgpu_job *job =to_amdgpu_job (s_job);struct amdgpu_task_info ti; +bool recover;memset (&ti,0 ,sizeof (struct amdgpu_task_info ));
@@ -42,6 +43,11 @@ static void amdgpu_job_timedout(struct drm_sched_job *s_job)return ; } + recover =amdgpu_device_should_recover_gpu (ring->adev); +if (s_job->sched->last_tmo_id == s_job->id) + goto skip_report; + + s_job->sched->last_tmo_id = s_job->id;amdgpu_vm_get_task_info (ring->adev, job->pasid, &ti); DRM_ERROR("ring %s timeout, signaled seq=%u, emitted seq=%u\n", job->base.sched->name, atomic_read(&ring->fence_drv.last_seq),
@@ -49,7 +55,11 @@ static void amdgpu_job_timedout(struct drm_sched_job *s_job)DRM_ERROR ("Process information: process %s pid %d thread %s pid %d\n" , ti.process_name, ti.tgid, ti.task_name, ti.pid); -if (amdgpu_device_should_recover_gpu (ring->adev)) +if (!recover) +DRM_INFO ("GPU recovery disabled.\n" ); + +skip_report: +if (recover)amdgpu_device_gpu_recover (ring->adev, job); }
include/drm/gpu_scheduler.h +1 -0
@@ -282,6 +282,7 @@ struct drm_gpu_scheduler {int hang_limit;atomic_t num_jobs;bool ready; +uint64_t last_tmo_id; }; int drm_sched_init(struct drm_gpu_scheduler *sched,
--
2.7.4
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
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): DM6PR12MB3305DCE921FE18B7C909C3C5840C0-lmeGfMZKVrGbWWUBpObc4QdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org
Hi Monk,
yeah, that's much closer to what I had in mind. But your comments got me thinking more about this.
What do you think about changing amdgpu_job_timedout() like this:
if (amdgpu_device_should_recover_gpu(ring->adev)) amdgpu_device_gpu_recover(ring->adev, job);
+ else
+ dma_fence_wait(s_job->s_fence->parent);
This way we would block the timeout worker until we are either manually resetting using debugfs or unloading the driver.
Regards,
Christian.
Am 10.05.19 um 09:19 schrieb Liu, Monk:
Quoted 86 lines
Hi Christian,
What about this one, no timer logic change on scheduler part, only the duplicated tmo report is muted
/Monk
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Monk Liu
Sent: Friday, May 10, 2019 3:18 PM
To: [email protected]
Cc: Liu, Monk <[email protected]>
Subject: [PATCH] drm/amdgpu: avoid duplicated tmo report on same job[CAUTION: External Email]
Signed-off-by Monk Liu <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 3 +-- drivers/gpu/drm/amd/amdgpu/amdgpu_job.c | 12 +++++++++++- include/drm/gpu_scheduler.h | 1 + 3 files changed, 13 insertions(+), 3 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +1
-2@@ -3356,8 +3356,7 @@ bool amdgpu_device_should_recover_gpu(struct amdgpu_device *adev)return true; disabled: -DRM_INFO ("GPU recovery disabled.\n" ); -return false; +return false; }drivers/gpu/drm/amd/amdgpu/amdgpu_job.c +11
-1@@ -33,6 +33,7 @@ static void amdgpu_job_timedout(struct drm_sched_job *s_job)struct amdgpu_ring *ring =to_amdgpu_ring (s_job->sched);struct amdgpu_job *job =to_amdgpu_job (s_job);struct amdgpu_task_info ti; +bool recover;memset (&ti,0 ,sizeof (struct amdgpu_task_info ));@@ -42,6 +43,11 @@ static void amdgpu_job_timedout(struct drm_sched_job *s_job)return ; } + recover =amdgpu_device_should_recover_gpu (ring->adev); +if (s_job->sched->last_tmo_id == s_job->id) + goto skip_report; + + s_job->sched->last_tmo_id = s_job->id;amdgpu_vm_get_task_info (ring->adev, job->pasid, &ti); DRM_ERROR("ring %s timeout, signaled seq=%u, emitted seq=%u\n", job->base.sched->name, atomic_read(&ring->fence_drv.last_seq),@@ -49,7 +55,11 @@ static void amdgpu_job_timedout(struct drm_sched_job *s_job)DRM_ERROR ("Process information: process %s pid %d thread %s pid %d\n" , ti.process_name, ti.tgid, ti.task_name, ti.pid); -if (amdgpu_device_should_recover_gpu (ring->adev)) +if (!recover) +DRM_INFO ("GPU recovery disabled.\n" ); + +skip_report: +if (recover)amdgpu_device_gpu_recover (ring->adev, job); }include/drm/gpu_scheduler.h +1
-1@@ -282,6 +282,7 @@ struct drm_gpu_scheduler {int hang_limit;atomic_t num_jobs;bool ready; +uint64_t last_tmo_id; }; int drm_sched_init(struct drm_gpu_scheduler *sched, --2.7.4
Quoted 4 lines
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
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): c1c9ec0a-6d11-849b-80a3-5d0d35b06dcd-5C7GfCeVMHo@public.gmane.org
Christian,
Would your approach leave the global queue (which holds TDR work) stuck there and other work item never get handled ?
/Monk
-----Original Message-----
From: Koenig, Christian
Sent: Friday, May 10, 2019 4:58 PM
To: Liu, Monk <[email protected]>; [email protected]
Subject: Re: [PATCH] drm/amdgpu: avoid duplicated tmo report on same job
Hi Monk,
yeah, that's much closer to what I had in mind. But your comments got me thinking more about this.
What do you think about changing amdgpu_job_timedout() like this:
if (amdgpu_device_should_recover_gpu(ring->adev)) amdgpu_device_gpu_recover(ring->adev, job);
+ else
+ dma_fence_wait(s_job->s_fence->parent);
This way we would block the timeout worker until we are either manually resetting using debugfs or unloading the driver.
Regards,
Christian.
Am 10.05.19 um 09:19 schrieb Liu, Monk:
Quoted 92 lines
Hi Christian,
What about this one, no timer logic change on scheduler part, only the duplicated tmo report is muted
/Monk
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Monk Liu
Sent: Friday, May 10, 2019 3:18 PM
To: [email protected]
Cc: Liu, Monk <[email protected]>
Subject: [PATCH] drm/amdgpu: avoid duplicated tmo report on same job[CAUTION: External Email]
Signed-off-by Monk Liu <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 3 +-- drivers/gpu/drm/amd/amdgpu/amdgpu_job.c | 12 +++++++++++- include/drm/gpu_scheduler.h | 1 + 3 files changed, 13 insertions(+), 3 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +1
-2@@ -3356,8 +3356,7 @@ bool amdgpu_device_should_recover_gpu(struct amdgpu_device *adev)return true; disabled: -DRM_INFO ("GPU recovery disabled.\n" ); -return false; +return false; }drivers/gpu/drm/amd/amdgpu/amdgpu_job.c +6
-0@@ -33,6 +33,7 @@ static void amdgpu_job_timedout(struct drm_sched_job *s_job)struct amdgpu_ring *ring =to_amdgpu_ring (s_job->sched);struct amdgpu_job *job =to_amdgpu_job (s_job);struct amdgpu_task_info ti; +bool recover;memset (&ti,0 ,sizeof (struct amdgpu_task_info ));@@ -42,6 +43,11 @@ static void amdgpu_job_timedout(struct drm_sched_job *s_job)return ; } + recover =amdgpu_device_should_recover_gpu (ring->adev); +if (s_job->sched->last_tmo_id == s_job->id) + goto skip_report; + + s_job->sched->last_tmo_id = s_job->id;amdgpu_vm_get_task_info (ring->adev, job->pasid, &ti); DRM_ERROR("ring %s timeout, signaled seq=%u, emitted seq=%u\n", job->base.sched->name,
atomic_read(&ring->fence_drv.last_seq),drivers/gpu/drm/amd/amdgpu/amdgpu_job.c +5
-1@@ -49,7 +55,11 @@ static void amdgpu_job_timedout(struct drm_sched_job *s_job)DRM_ERROR ("Process information: process %s pid %d thread %s pid %d\n" , ti.process_name, ti.tgid, ti.task_name, ti.pid); -if (amdgpu_device_should_recover_gpu (ring->adev)) +if (!recover) +DRM_INFO ("GPU recovery disabled.\n" ); + +skip_report: +if (recover)amdgpu_device_gpu_recover (ring->adev, job); }include/drm/gpu_scheduler.h +1
-1@@ -282,6 +282,7 @@ struct drm_gpu_scheduler {int hang_limit;atomic_t num_jobs;bool ready; +uint64_t last_tmo_id; }; int drm_sched_init(struct drm_gpu_scheduler *sched, --2.7.4
Quoted 4 lines
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
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): DM6PR12MB3305BCB914F1A80B99AFC6CD840C0-lmeGfMZKVrGbWWUBpObc4QdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org
Yeah, that's indeed a bit problematic. How about calling drm_sched_suspend_timeout() then?
On the other hand just suppressing the logging is fine with me as well.
Christian.
Am 10.05.19 um 12:01 schrieb Liu, Monk:
Quoted 117 lines
Christian,
Would your approach leave the global queue (which holds TDR work) stuck there and other work item never get handled ?
/Monk
-----Original Message-----
From: Koenig, Christian
Sent: Friday, May 10, 2019 4:58 PM
To: Liu, Monk <[email protected]>; [email protected]
Subject: Re: [PATCH] drm/amdgpu: avoid duplicated tmo report on same jobHi Monk,
yeah, that's much closer to what I had in mind. But your comments got me thinking more about this.
What do you think about changing
amdgpu_job_timedout()like this:
if (amdgpu_device_should_recover_gpu(ring->adev))amdgpu_device_gpu_recover(ring->adev, job);
+ else
+dma_fence_wait(s_job->s_fence->parent);This way we would block the timeout worker until we are either manually resetting using debugfs or unloading the driver.
Regards,
Christian.Am 10.05.19 um 09:19 schrieb Liu, Monk:
Quoted 88 lines
Hi Christian,
What about this one, no timer logic change on scheduler part, only the duplicated tmo report is muted
/Monk
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Monk Liu
Sent: Friday, May 10, 2019 3:18 PM
To: [email protected]
Cc: Liu, Monk <[email protected]>
Subject: [PATCH] drm/amdgpu: avoid duplicated tmo report on same job[CAUTION: External Email]
Signed-off-by Monk Liu <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 3 +-- drivers/gpu/drm/amd/amdgpu/amdgpu_job.c | 12 +++++++++++- include/drm/gpu_scheduler.h | 1 + 3 files changed, 13 insertions(+), 3 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +1
-2@@ -3356,8 +3356,7 @@ bool amdgpu_device_should_recover_gpu(struct amdgpu_device *adev)return true; disabled: -DRM_INFO ("GPU recovery disabled.\n" ); -return false; +return false; }drivers/gpu/drm/amd/amdgpu/amdgpu_job.c +6
-0@@ -33,6 +33,7 @@ static void amdgpu_job_timedout(struct drm_sched_job *s_job)struct amdgpu_ring *ring =to_amdgpu_ring (s_job->sched);struct amdgpu_job *job =to_amdgpu_job (s_job);struct amdgpu_task_info ti; +bool recover;memset (&ti,0 ,sizeof (struct amdgpu_task_info ));@@ -42,6 +43,11 @@ static void amdgpu_job_timedout(struct drm_sched_job *s_job)return ; } + recover =amdgpu_device_should_recover_gpu (ring->adev); +if (s_job->sched->last_tmo_id == s_job->id) + goto skip_report; + + s_job->sched->last_tmo_id = s_job->id;amdgpu_vm_get_task_info (ring->adev, job->pasid, &ti); DRM_ERROR("ring %s timeout, signaled seq=%u, emitted seq=%u\n", job->base.sched->name,
atomic_read(&ring->fence_drv.last_seq),drivers/gpu/drm/amd/amdgpu/amdgpu_job.c +5
-1@@ -49,7 +55,11 @@ static void amdgpu_job_timedout(struct drm_sched_job *s_job)DRM_ERROR ("Process information: process %s pid %d thread %s pid %d\n" , ti.process_name, ti.tgid, ti.task_name, ti.pid); -if (amdgpu_device_should_recover_gpu (ring->adev)) +if (!recover) +DRM_INFO ("GPU recovery disabled.\n" ); + +skip_report: +if (recover)amdgpu_device_gpu_recover (ring->adev, job); }include/drm/gpu_scheduler.h +1
-0@@ -282,6 +282,7 @@ struct drm_gpu_scheduler {int hang_limit;atomic_t num_jobs;bool ready; +uint64_t last_tmo_id; };
Quoted 8 lines
Quoted 8 lines
include/drm/gpu_scheduler.h +0
-1int drm_sched_init(struct drm_gpu_scheduler *sched, --2.7.4
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
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): 2b8853fc-23ca-a766-275f-ec1706e86c16-5C7GfCeVMHo@public.gmane.org
I think it's a neat approach, thanks !
/Monk
-----Original Message-----
From: Koenig, Christian
Sent: Friday, May 10, 2019 8:07 PM
To: Liu, Monk <[email protected]>; [email protected]
Subject: Re: [PATCH] drm/amdgpu: avoid duplicated tmo report on same job
Yeah, that's indeed a bit problematic. How about calling drm_sched_suspend_timeout() then?
On the other hand just suppressing the logging is fine with me as well.
Christian.
Am 10.05.19 um 12:01 schrieb Liu, Monk:
Quoted 118 lines
Christian,
Would your approach leave the global queue (which holds TDR work) stuck there and other work item never get handled ?
/Monk
-----Original Message-----
From: Koenig, Christian
Sent: Friday, May 10, 2019 4:58 PM
To: Liu, Monk <[email protected]>; [email protected]
Subject: Re: [PATCH] drm/amdgpu: avoid duplicated tmo report on same jobHi Monk,
yeah, that's much closer to what I had in mind. But your comments got me thinking more about this.
What do you think about changing
amdgpu_job_timedout()like this:
if (amdgpu_device_should_recover_gpu(ring->adev))amdgpu_device_gpu_recover(ring->adev, job);
+ else
+dma_fence_wait(s_job->s_fence->parent);This way we would block the timeout worker until we are either manually resetting using debugfs or unloading the driver.
Regards,
Christian.Am 10.05.19 um 09:19 schrieb Liu, Monk:
Quoted 88 lines
Hi Christian,
What about this one, no timer logic change on scheduler part, only the duplicated tmo report is muted
/Monk
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Monk Liu
Sent: Friday, May 10, 2019 3:18 PM
To: [email protected]
Cc: Liu, Monk <[email protected]>
Subject: [PATCH] drm/amdgpu: avoid duplicated tmo report on same job[CAUTION: External Email]
Signed-off-by Monk Liu <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 3 +-- drivers/gpu/drm/amd/amdgpu/amdgpu_job.c | 12 +++++++++++- include/drm/gpu_scheduler.h | 1 + 3 files changed, 13 insertions(+), 3 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +1
-2@@ -3356,8 +3356,7 @@ bool amdgpu_device_should_recover_gpu(struct amdgpu_device *adev)return true; disabled: -DRM_INFO ("GPU recovery disabled.\n" ); -return false; +return false; }drivers/gpu/drm/amd/amdgpu/amdgpu_job.c +6
-0@@ -33,6 +33,7 @@ static void amdgpu_job_timedout(struct drm_sched_job *s_job)struct amdgpu_ring *ring =to_amdgpu_ring (s_job->sched);struct amdgpu_job *job =to_amdgpu_job (s_job);struct amdgpu_task_info ti; +bool recover;memset (&ti,0 ,sizeof (struct amdgpu_task_info ));@@ -42,6 +43,11 @@ static void amdgpu_job_timedout(struct drm_sched_job *s_job)return ; } + recover =amdgpu_device_should_recover_gpu (ring->adev); +if (s_job->sched->last_tmo_id == s_job->id) + goto skip_report; + + s_job->sched->last_tmo_id = s_job->id;amdgpu_vm_get_task_info (ring->adev, job->pasid, &ti); DRM_ERROR("ring %s timeout, signaled seq=%u, emitted seq=%u\n", job->base.sched->name,
atomic_read(&ring->fence_drv.last_seq),drivers/gpu/drm/amd/amdgpu/amdgpu_job.c +5
-1@@ -49,7 +55,11 @@ static void amdgpu_job_timedout(struct drm_sched_job *s_job)DRM_ERROR ("Process information: process %s pid %d thread %s pid %d\n" , ti.process_name, ti.tgid, ti.task_name, ti.pid); -if (amdgpu_device_should_recover_gpu (ring->adev)) +if (!recover) +DRM_INFO ("GPU recovery disabled.\n" ); + +skip_report: +if (recover)amdgpu_device_gpu_recover (ring->adev, job); }(quoted diff) +0
-0
b/include/drm/gpu_scheduler.hindex 9c2a957..1944d27 100644include/drm/gpu_scheduler.h +1
-0@@ -282,6 +282,7 @@ struct drm_gpu_scheduler {int hang_limit;atomic_t num_jobs;bool ready; +uint64_t last_tmo_id; };
Quoted 8 lines
Quoted 8 lines
include/drm/gpu_scheduler.h +0
-1int drm_sched_init(struct drm_gpu_scheduler *sched, --2.7.4
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx