[PATCH 1/6] drm/sched: Avoid memory leaks with cancel_job() callback
Maíra Canal
mcanal at igalia.com
Fri Jul 4 12:18:47 UTC 2025
Hi Philipp,
On 01/07/25 10:21, Philipp Stanner wrote:
> Since its inception, the GPU scheduler can leak memory if the driver
> calls drm_sched_fini() while there are still jobs in flight.
>
> The simplest way to solve this in a backwards compatible manner is by
> adding a new callback, drm_sched_backend_ops.cancel_job(), which
> instructs the driver to signal the hardware fence associated with the
> job. Afterwards, the scheduler can savely use the established free_job()
s/savely/safely
> callback for freeing the job.
>
> Implement the new backend_ops callback cancel_job().
>
> Suggested-by: Tvrtko Ursulin <tvrtko.ursulin at igalia.com>
> Link: https://lore.kernel.org/dri-devel/20250418113211.69956-1-tvrtko.ursulin@igalia.com/
> Signed-off-by: Philipp Stanner <phasta at kernel.org>
Reviewed-by: Maíra Canal <mcanal at igalia.com>
Best Regards,
- Maíra
More information about the dri-devel
mailing list