Skip to contentSkip to conversation

Revert "drm/amd/scheduler:fix duplicate operation in entity fini"

PATCH In review Monk Liu 2 participants 3 messages Nov 2, 2017 2 messages not in the archive

Subsystems (2)
lore
Share & tools
lore

Monk Liu

author
#0 lore raw

PATCH 1/1 Revert "drm/amd/scheduler:fix duplicate operation in entity fini"

fix memory leak.
This reverts commit d6951b49faa8447a6a77cdb1ef3346b1a1786d31. because when entity_fini is interrupted the jobs in queue still not processed with job_begin, so the finish_cb is not hooked on sched fence, we still need manually do cleanups.

Change-Id: I6e17bfeeac85062bc52f1d51b9697852b084845c

---
 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
index 6f041e8..7aa6455 100644
@@ -231,10 +231,11 @@ void amd_sched_entity_fini(struct amd_gpu_scheduler *sched,
 		kthread_unpark(sched->thread);
 		while ((job = to_amd_sched_job(spsc_queue_pop(&entity->job_queue)))) {
 			struct amd_sched_fence *s_fence = job->s_fence;
-
 			amd_sched_fence_scheduled(s_fence);
 			dma_fence_set_error(&s_fence->finished, -ESRCH);
 			amd_sched_fence_finished(s_fence);
+			dma_fence_put(&s_fence->finished);
+			sched->ops->free_job(job);
 		}
 	}
 }
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): 1509593555-17622-1-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org

#2 lore raw
Quoted 9 lines

-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Monk Liu
Sent: Wednesday, November 01, 2017 11:33 PM
To: [email protected]
Cc: Liu, Monk
Subject: [PATCH] Revert "drm/amd/scheduler:fix duplicate operation in entity fini"

Quoted 7 lines

fix memory leak.
This reverts commit d6951b49faa8447a6a77cdb1ef3346b1a1786d31. because when entity_fini is interrupted the jobs in queue still not processed with job_begin, so the finish_cb is not hooked on sched fence, we still need manually do cleanups.

Change-Id: I6e17bfeeac85062bc52f1d51b9697852b084845c

Missing your signed-off-by.

Alex

Quoted 27 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 +2 -1
index 6f041e8..7aa6455 100644
@@ -231,10 +231,11 @@ void amd_sched_entity_fini(struct
 amd_gpu_scheduler *sched,
 		kthread_unpark(sched->thread);
 		while ((job = to_amd_sched_job(spsc_queue_pop(&entity-
 >job_queue)))) {
 			struct amd_sched_fence *s_fence = job->s_fence;
-
 			amd_sched_fence_scheduled(s_fence);
 			dma_fence_set_error(&s_fence->finished, -ESRCH);
 			amd_sched_fence_finished(s_fence);
+			dma_fence_put(&s_fence->finished);
+			sched->ops->free_job(job);
 		}

}
}
--
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): BN6PR12MB165269386C80297C39A8FF87F75C0-/b2+HYfkarQqUD6E6FAiowdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org

author
#4 lore raw

Yeah, will do

-----Original Message-----
From: Deucher, Alexander
Sent: 2017年11月2日 11:57
To: Liu, Monk <[email protected]>; [email protected]
Cc: Liu, Monk <[email protected]>
Subject: RE: [PATCH] Revert "drm/amd/scheduler:fix duplicate operation in entity fini"

Quoted 9 lines

-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Monk Liu
Sent: Wednesday, November 01, 2017 11:33 PM
To: [email protected]
Cc: Liu, Monk
Subject: [PATCH] Revert "drm/amd/scheduler:fix duplicate operation in entity fini"

Quoted 7 lines

fix memory leak.
This reverts commit d6951b49faa8447a6a77cdb1ef3346b1a1786d31. because when entity_fini is interrupted the jobs in queue still not processed with job_begin, so the finish_cb is not hooked on sched fence, we still need manually do cleanups.

Change-Id: I6e17bfeeac85062bc52f1d51b9697852b084845c

Missing your signed-off-by.

Alex

Quoted 27 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 +2 -1
index 6f041e8..7aa6455 100644
@@ -231,10 +231,11 @@ void amd_sched_entity_fini(struct 
 amd_gpu_scheduler *sched,
 		kthread_unpark(sched->thread);
 		while ((job = to_amd_sched_job(spsc_queue_pop(&entity-
 >job_queue)))) {
 			struct amd_sched_fence *s_fence = job->s_fence;
-
 			amd_sched_fence_scheduled(s_fence);
 			dma_fence_set_error(&s_fence->finished, -ESRCH);
 			amd_sched_fence_finished(s_fence);
+			dma_fence_put(&s_fence->finished);
+			sched->ops->free_job(job);
 		}

}
}
--
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