linux/drivers/gpu
Philipp Stanner bf8bbaefaa drm/sched: Avoid memory leaks with cancel_job() callback
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 safely use the established free_job()
callback for freeing the job.

Implement the new backend_ops callback cancel_job().

Suggested-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Link: https://lore.kernel.org/dri-devel/20250418113211.69956-1-tvrtko.ursulin@igalia.com/
Reviewed-by: Maíra Canal <mcanal@igalia.com>
Acked-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Signed-off-by: Philipp Stanner <phasta@kernel.org>
Link: https://lore.kernel.org/r/20250710125412.128476-4-phasta@kernel.org
History 2025-07-10 17:07:08 +02:00
..
drm drm/sched: Avoid memory leaks with cancel_job() callback 2025-07-10 17:07:08 +02:00
host1x gpu: host1x: Use for_each_available_child_of_node_scoped() 2025-05-07 18:09:30 +02:00
ipu-v3 gpu: ipu-v3: Switch to irq_find_mapping() 2025-05-16 21:06:12 +02:00
nova-core drm for 6.16-rc1 2025-05-28 09:46:39 -07:00
trace gpu/trace: make TRACE_GPU_MEM configurable 2025-07-08 09:34:47 -07:00
vga drm: Do delayed switcheroo in drm_lastclose() 2024-08-13 16:21:07 +02:00
Makefile gpu: nova-core: add initial driver stub 2025-03-09 19:24:27 +01:00