Skip to contentSkip to conversation

drm/amdkfd: fix a memory leak issue

PATCH In review Dennis Li 2 participants 2 messages Sep 2, 2020 – Sep 8, 2020

Subsystems (3)
lore
Share & tools
lore

Dennis Li

author
#0 lore raw

PATCH 1/1 drm/amdkfd: fix a memory leak issue

In the resume stage of GPU recovery, start_cpsch will call pm_init which set pm->allocated as false, cause the next pm_release_ib has no chance to release ib memory.

Add pm_release_ib in stop_cpsch which will be called in the suspend stage of GPU recovery.

drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c +2 -0
index 069ba4be1e8f..20ef048d6a03 100644
@@ -1192,6 +1192,8 @@ static int stop_cpsch(struct device_queue_manager *dqm)
 	dqm->sched_running = false;
 	dqm_unlock(dqm);
 
+	pm_release_ib(&dqm->packets);
+
 	kfd_gtt_sa_free(dqm->dev, dqm->fence_mem);
 	pm_uninit(&dqm->packets, hanging);
 
Signature · 6 lines
2.17.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
maintainer Reviewed-by on v1 1/1
#1 lore raw

Am 2020-09-02 um 5:32 a.m. schrieb Dennis Li:

Quoted 8 lines

In the resume stage of GPU recovery, start_cpsch will call pm_init which set pm->allocated as false, cause the next pm_release_ib has no chance to release ib memory.

Add pm_release_ib in stop_cpsch which will be called in the suspend stage of GPU recovery.

Quoted 6 lines
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c +0 -0
index 069ba4be1e8f..20ef048d6a03 100644

drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c static int stop_cpsch(struct device_queue_manager *dqm) · line 1199

Quoted 8 lines
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c +2 -0
@@ -1192,6 +1192,8 @@ static int stop_cpsch(struct device_queue_manager *dqm)
 	dqm->sched_running = false;
 	dqm_unlock(dqm);
 
+	pm_release_ib(&dqm->packets);
+
 	kfd_gtt_sa_free(dqm->dev, dqm->fence_mem);
 	pm_uninit(&dqm->packets, hanging);
 

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