[PATCH 2/2] Revert "drm/amd/scheduler:fix duplicate operation in entity fini"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 2017å¹´11æ??02æ?¥ 15:50, Monk Liu wrote:
> 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
> Signed-off-by: Monk Liu <Monk.Liu at amd.com>
Reviewed-by: Chunming Zhou <david1.zhou at amd.com>
> ---
>   drivers/gpu/drm/amd/scheduler/gpu_scheduler.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c b/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c
> index 6f041e8..7aa6455 100644
> --- a/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c
> +++ b/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c
> @@ -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);
>   		}
>   	}
>   }



[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux