drm/amdgpu:fix gpu recover missing skipping
Subsystems (2)
PATCH 1/1 drm/amdgpu:fix gpu recover missing skipping
if app close CTX right after IB submit, gpu recover will failed to find out the entity/ctx behind the guilty job thus lead to bad job skipping in scheduler failed
to fix this corner case just move the job->karma increasing out of the condition that the backing entity was found that way the job itself will be "guilty" anyway
--- drivers/gpu/drm/amd/scheduler/gpu_scheduler.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/scheduler/gpu_scheduler.c +2 -1
@@ -464,6 +464,7 @@ void amd_sched_hw_job_reset(struct amd_gpu_scheduler *sched, struct amd_sched_jospin_unlock (&sched->job_list_lock);if (bad) { +atomic_inc (&bad->karma);/* don't increase @bad's karma if it's from KERNEL RQ, * becuase sometimes GPU hang would cause kernel jobs (like VM updating jobs) * corrupt but keep in mind that kernel jobs always considered good.
@@ -474,7 +475,7 @@ void amd_sched_hw_job_reset(struct amd_gpu_scheduler *sched, struct amd_sched_jospin_lock (&rq->lock);list_for_each_entry_safe (entity, tmp, &rq->entities, list) {if (bad->s_fence->scheduled.context == entity->fence_context) { -if (atomic_inc_return (&bad->karma) > bad->sched->hang_limit) +if (atomic_read (&bad->karma) > bad->sched->hang_limit)if (entity->guilty)atomic_set (entity->guilty,1 );break ;
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): 1510123148-23330-1-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org
Quoted 52 lines
-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Monk Liu
Sent: Wednesday, November 08, 2017 2:39 PM
To: [email protected]
Cc: Liu, Monk <[email protected]>
Subject: [PATCH] drm/amdgpu:fix gpu recover missing skippingif app close CTX right after IB submit, gpu recover will failed to find out the entity/ctx behind the guilty job thus lead to bad job skipping in scheduler failed
to fix this corner case just move the
job->karmaincreasing out of the condition that the backing entity was found that way the job itself will be "guilty" anywayChange-Id Ia30f02df9297a343d6d8dace496e237827dd1548Signed-off-by Monk Liu <[email protected]>--- drivers/gpu/drm/amd/scheduler/gpu_scheduler.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/gpu/drm/amd/scheduler/gpu_scheduler.c +0
-0@@ -464,6 +464,7 @@ void amd_sched_hw_job_reset(struct
amd_gpu_scheduler*sched, structamd_sched_jodrivers/gpu/drm/amd/scheduler/gpu_scheduler.c +1
-0spin_unlock (&sched->job_list_lock);if (bad) { +atomic_inc (&bad->karma);/* don't increase @bad's karma if it's from KERNEL RQ, * becuase sometimes GPU hang would cause kernel jobs (like VM updating jobs)
* corrupt but keep in mind that kernel jobs always
considered good.drivers/gpu/drm/amd/scheduler/gpu_scheduler.c +0
-0@@ -474,7 +475,7 @@ void amd_sched_hw_job_reset(struct
amd_gpu_scheduler*sched, structamd_sched_jodrivers/gpu/drm/amd/scheduler/gpu_scheduler.c +0
-0spin_lock (&rq->lock); list_for_each_entry_safe(entity, tmp, &rq->entities,list) {
if (bad->s_fence->scheduled.context==entity->fence_context) {drivers/gpu/drm/amd/scheduler/gpu_scheduler.c +0
-1- if (atomic_inc_return(&bad->karma) > bad-Quoted 1 line
sched->hang_limit)drivers/gpu/drm/amd/scheduler/gpu_scheduler.c +1
-0+ if (atomic_read(&bad->karma) > bad-Quoted 1 line
sched->hang_limit)drivers/gpu/drm/amd/scheduler/gpu_scheduler.c +0
-0if (entity->guilty) atomic_set(entity-Quoted 1 line
guilty, 1);
Quoted 8 lines
break;
--
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
Christian König
Reviewed-byAm 08.11.2017 um 07:39 schrieb Monk Liu:
Quoted 10 lines
if app close CTX right after IB submit, gpu recover will failed to find out the entity/ctx behind the guilty job thus lead to bad job skipping in scheduler failed
to fix this corner case just move the
job->karmaincreasing out of the condition that the backing entity was found that way the job itself will be "guilty" anywayChange-Id Ia30f02df9297a343d6d8dace496e237827dd1548Signed-off-by Monk Liu <[email protected]>
Quoted 17 lines
--- drivers/gpu/drm/amd/scheduler/gpu_scheduler.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/gpu/drm/amd/scheduler/gpu_scheduler.c +1
-0@@ -464,6 +464,7 @@ void amd_sched_hw_job_reset(struct amd_gpu_scheduler *sched, struct amd_sched_jospin_unlock (&sched->job_list_lock);if (bad) { +atomic_inc (&bad->karma);/* don't increase @bad's karma if it's from KERNEL RQ, * becuase sometimes GPU hang would cause kernel jobs (like VM updating jobs) * corrupt but keep in mind that kernel jobs always considered good.
drivers/gpu/drm/amd/scheduler/gpu_scheduler.c void amd_sched_hw_job_reset(struct amd_gpu_scheduler *sched, struct amd_sched_jo · line 481
Quoted 8 lines
drivers/gpu/drm/amd/scheduler/gpu_scheduler.c +1
-1@@ -474,7 +475,7 @@ void amd_sched_hw_job_reset(struct amd_gpu_scheduler *sched, struct amd_sched_jospin_lock (&rq->lock);list_for_each_entry_safe (entity, tmp, &rq->entities, list) {if (bad->s_fence->scheduled.context == entity->fence_context) { -if (atomic_inc_return (&bad->karma) > bad->sched->hang_limit) +if (atomic_read (&bad->karma) > bad->sched->hang_limit)if (entity->guilty)atomic_set (entity->guilty,1 );break ;
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx