Skip to contentSkip to conversation

drm/amdkfd: Signal eviction fence on process destruction (v2)

PATCH Felix Kuehling 2 participants 2 messages Mar 5, 2020 – Mar 6, 2020 3 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

#3 lore raw

[moving to public mailing list]

Thank you. I'll also apply patch 2/2 to amd-staging-drm-next. It's not fixing a memory leak there, but it should make cleanup after process termination more efficient by avoiding delayed delete of BOs.

Regards,
  Felix

Quoted 28 lines · Xinhui

Series is Reviewed-by: xinhui pan <[email protected]>

Quoted 26 lines

2020年3月5日 05:50,Kuehling, Felix <[email protected]> 写道:

Otherwise BOs may wait for the fence indefinitely and never be destroyed.

v2: Signal the fence right after destroying queues to avoid unnecessary
delaye-delete in kfd_process_wq_release

---
drivers/gpu/drm/amd/amdkfd/kfd_process.c | 5 +++++

1 file changed, 5 insertions(+)
drivers/gpu/drm/amd/amdkfd/kfd_process.c +5 -0
index d5d4660221af..26f7f178b66d 100644
@@ -625,6 +625,11 @@ static void kfd_process_notifier_release(struct mmu_notifier *mn,
 
 	/* Indicate to other users that MM is no longer valid */
 	p->mm = NULL;
+	/* Signal the eviction fence after user mode queues are
+	 * destroyed. This allows any BOs to be freed without
+	 * triggering pointless evictions or waiting for fences.
+	 */
+	dma_fence_signal(p->ef);
 
Quoted 5 lines
Quoted 5 lines
drivers/gpu/drm/amd/amdkfd/kfd_process.c +0 -0
 	mutex_unlock(&p->mutex);
 
Signature · 1 line
2.25.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#4 lore raw

Yeah, that one looks important. Feel free to add an Acked-by: Christian König <[email protected]>.

Regards,
Christian.

Am 05.03.20 um 17:06 schrieb Felix Kuehling:

Quoted 39 lines

[moving to public mailing list]

Thank you. I'll also apply patch 2/2 to amd-staging-drm-next. It's not fixing a memory leak there, but it should make cleanup after process termination more efficient by avoiding delayed delete of BOs.

Regards,
  Felix

Quoted 31 lines · Xinhui

Series is Reviewed-by: xinhui pan <[email protected]>

Quoted 29 lines

2020年3月5日 05:50,Kuehling, Felix <[email protected]> 写道:

Otherwise BOs may wait for the fence indefinitely and never be destroyed.

v2: Signal the fence right after destroying queues to avoid unnecessary delaye-delete in kfd_process_wq_release

---
drivers/gpu/drm/amd/amdkfd/kfd_process.c | 5 +++++

1 file changed, 5 insertions(+)
drivers/gpu/drm/amd/amdkfd/kfd_process.c +5 -0
index d5d4660221af..26f7f178b66d 100644
@@ -625,6 +625,11 @@ static void kfd_process_notifier_release(struct 
 mmu_notifier *mn,
 
     /* Indicate to other users that MM is no longer valid */
     p->mm = NULL;
+    /* Signal the eviction fence after user mode queues are
+     * destroyed. This allows any BOs to be freed without
+     * triggering pointless evictions or waiting for fences.
+     */
+    dma_fence_signal(p->ef);
 
     mutex_unlock(&p->mutex);
Quoted 7 lines
Quoted 3 lines
Quoted 3 lines
Signature · 1 line
2.25.1

_______________________________________________
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