drm/xe: Use RCU free for exec queue, not GuC exec queue
Subsystems (2)
Matthew Brost
maintainerPATCH 1/1 drm/xe: Use RCU free for exec queue, not GuC exec queue
The exec queue name is used in dma-fence timelines, not the GuC exec queue. Therefore, the exec queue itself requires RCU freeing rather than the GuC exec queue.
Fixes 6bd90e700b42 ("drm/xe: Make dma-fences compliant with the safe access rules")
Cc Tvrtko Ursulin <[email protected]>
Signed-off-by Matthew Brost <[email protected]>
--- drivers/gpu/drm/xe/xe_exec_queue.c | 7 ++++++- drivers/gpu/drm/xe/xe_exec_queue_types.h | 2 ++ drivers/gpu/drm/xe/xe_guc_exec_queue_types.h | 2 -- drivers/gpu/drm/xe/xe_guc_submit.c | 7 +------ 4 files changed, 9 insertions(+), 9 deletions(-)
drivers/gpu/drm/xe/xe_exec_queue.c +6 -1
@@ -47,7 +47,11 @@ static void __xe_exec_queue_free(struct xe_exec_queue *q)if (q->xef)xe_file_put (q->xef); -kfree (q); +/* +* RCU free due sched being exported via DRM scheduler fences +* (timeline name). +*/ +kfree_rcu (q, rcu); } static struct xe_exec_queue *__xe_exec_queue_alloc(struct xe_device *xe,
@@ -82,6 +86,7 @@ static struct xe_exec_queue *__xe_exec_queue_alloc(struct xe_device *xe,INIT_LIST_HEAD (&q->multi_gt_link);INIT_LIST_HEAD (&q->hw_engine_group_link);INIT_LIST_HEAD (&q->pxp.link); +init_rcu_head (&q->rcu); q->sched_props.timeslice_us = hwe->eclass->sched_props.timeslice_us; q->sched_props.preempt_timeout_us =
drivers/gpu/drm/xe/xe_exec_queue_types.h +2 -0
@@ -43,6 +43,8 @@ struct xe_exec_queue {/** @gt: GT structure this exec queue can submit to */ struct xe_gt *gt; +/** @rcu: For safe freeing of exported dma fences */ +struct rcu_head rcu;/** * @hwe: A hardware of the same class. May (physical engine) or may not * (virtual engine) be where jobs actual engine up running. Should never
drivers/gpu/drm/xe/xe_guc_exec_queue_types.h +0 -2
@@ -20,8 +20,6 @@ struct xe_exec_queue;struct xe_guc_exec_queue {/** @q: Backpointer to parent xe_exec_queue */ struct xe_exec_queue *q; -/** @rcu: For safe freeing of exported dma fences */ -struct rcu_head rcu;/** @sched: GPU scheduler for this xe_exec_queue */ struct xe_gpu_scheduler sched;/** @entity: Scheduler entity for this xe_exec_queue */
drivers/gpu/drm/xe/xe_guc_submit.c +1 -6
@@ -1299,11 +1299,7 @@ static void __guc_exec_queue_fini_async(struct work_struct *w)xe_sched_entity_fini (&ge->entity);xe_sched_fini (&ge->sched); -/* -* RCU free due sched being exported via DRM scheduler fences -* (timeline name). -*/ -kfree_rcu (ge, rcu); +kfree (ge);xe_exec_queue_fini (q);xe_pm_runtime_put (guc_to_xe (guc)); }
@@ -1486,7 +1482,6 @@ static int guc_exec_queue_init(struct xe_exec_queue *q) q->guc = ge; ge->q = q; -init_rcu_head (&ge->rcu);init_waitqueue_head (&ge->suspend_wait);for (i =0 ; i <MAX_STATIC_MSG_TYPE ; ++i)
Signature · 1 line
2.34.1