[PATCH] drm/amdkfd: fix a memory leak issue

Felix Kuehling felix.kuehling at amd.com
Tue Sep 8 04:57:37 UTC 2020


Am 2020-09-02 um 5:32 a.m. schrieb Dennis Li:
> 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.
>
> Signed-off-by: Dennis Li <Dennis.Li at amd.com>

Reviewed-by: Felix Kuehling <Felix.Kuehling at amd.com>


>
> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
> index 069ba4be1e8f..20ef048d6a03 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
> @@ -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);
>  


More information about the amd-gfx mailing list