History

Revert "drm/xe/multi_queue: Support active group after primary is destroyed"

This reverts commit 3131a43ecb346ae3b5287ee195779fc38c6fcd11. There is no must have requirement for this feature from Compute UMD.

Niranjana Vishwanathapura committed 10 months ago

Commit caaed1d1 parent e70711b5 files · +3 −69Browse files

Unified · Split

5 files
  1. drivers/gpu/drm/xe/xe_device.c +1 −6
  2. drivers/gpu/drm/xe/xe_exec_queue.c +2 −53
  3. drivers/gpu/drm/xe/xe_exec_queue.h +0 −2
  4. drivers/gpu/drm/xe/xe_exec_queue_types.h +0 −4
  5. include/uapi/drm/xe_drm.h +0 −4
drivers/gpu/drm/xe/xe_device.c+1−6
@@ -180,12 +180,7 @@ static void xe_file_close(struct drm_device *dev, struct drm_file *file) · 179 unmodified lines
180180 xa_for_each(&xef->exec_queue.xa, idx, q) {
181181 if (q->vm && q->hwe->hw_engine_group)
182182 xe_hw_engine_group_del_exec_queue(q->hwe->hw_engine_group, q);
183−
184− if (xe_exec_queue_is_multi_queue_primary(q))
185− xe_exec_queue_group_kill_put(q->multi_queue.group);
186− else
187− xe_exec_queue_kill(q);
188−
183+ xe_exec_queue_kill(q);
189184 xe_exec_queue_put(q);
190185 }
191186 xa_for_each(&xef->vm.xa, idx, vm)
drivers/gpu/drm/xe/xe_exec_queue.c+2−53
@@ -467,26 +467,6 @@ struct xe_exec_queue *xe_exec_queue_create_bind(struct xe_device *xe, · 466 unmodified lines
467467 }
468468 ALLOW_ERROR_INJECTION(xe_exec_queue_create_bind, ERRNO);
469469
470−static void xe_exec_queue_group_kill(struct kref *ref)
471−{
472− struct xe_exec_queue_group *group = container_of(ref, struct xe_exec_queue_group,
473− kill_refcount);
474− xe_exec_queue_kill(group->primary);
475−}
476−
477−static inline void xe_exec_queue_group_kill_get(struct xe_exec_queue_group *group)
478−{
479− kref_get(&group->kill_refcount);
480−}
481−
482−void xe_exec_queue_group_kill_put(struct xe_exec_queue_group *group)
483−{
484− if (!group)
485− return;
486−
487− kref_put(&group->kill_refcount, xe_exec_queue_group_kill);
488−}
489−
490470 void xe_exec_queue_destroy(struct kref *ref)
491471 {
492472 struct xe_exec_queue *q = container_of(ref, struct xe_exec_queue, refcount);
@@ -716,7 +696,6 @@ static int xe_exec_queue_group_init(struct xe_device *xe, struct xe_exec_queue * · 223 unmodified lines
716696 group->primary = q;
717697 group->cgp_bo = bo;
718698 INIT_LIST_HEAD(&group->list);
719− kref_init(&group->kill_refcount);
720699 xa_init_flags(&group->xa, XA_FLAGS_ALLOC1);
721700 mutex_init(&group->list_lock);
722701 q->multi_queue.group = group;
@@ -792,11 +771,6 @@ static int xe_exec_queue_group_add(struct xe_device *xe, struct xe_exec_queue *q · 69 unmodified lines
792771
793772 q->multi_queue.pos = pos;
794773
795− if (group->primary->multi_queue.keep_active) {
796− xe_exec_queue_group_kill_get(group);
797− q->multi_queue.keep_active = true;
798− }
799−
800774 return 0;
801775 }
802776
@@ -810,11 +784,6 @@ static void xe_exec_queue_group_delete(struct xe_device *xe, struct xe_exec_queu · 7 unmodified lines
810784 lrc = xa_erase(&group->xa, q->multi_queue.pos);
811785 xe_assert(xe, lrc);
812786 xe_lrc_put(lrc);
813−
814− if (q->multi_queue.keep_active) {
815− xe_exec_queue_group_kill_put(group);
816− q->multi_queue.keep_active = false;
817− }
818787 }
819788
820789 static int exec_queue_set_multi_group(struct xe_device *xe, struct xe_exec_queue *q,
@@ -836,24 +805,12 @@ static int exec_queue_set_multi_group(struct xe_device *xe, struct xe_exec_queue · 15 unmodified lines
836805 return -EINVAL;
837806
838807 if (value & DRM_XE_MULTI_GROUP_CREATE) {
839− if (XE_IOCTL_DBG(xe, value & ~(DRM_XE_MULTI_GROUP_CREATE |
840− DRM_XE_MULTI_GROUP_KEEP_ACTIVE)))
841− return -EINVAL;
842−
843− /*
844− * KEEP_ACTIVE is not supported in preempt fence mode as in that mode,
845− * VM_DESTROY ioctl expects all exec queues of that VM are already killed.
846− */
847− if (XE_IOCTL_DBG(xe, (value & DRM_XE_MULTI_GROUP_KEEP_ACTIVE) &&
848− xe_vm_in_preempt_fence_mode(q->vm)))
808+ if (XE_IOCTL_DBG(xe, value & ~DRM_XE_MULTI_GROUP_CREATE))
849809 return -EINVAL;
850810
851811 q->multi_queue.valid = true;
852812 q->multi_queue.is_primary = true;
853813 q->multi_queue.pos = 0;
854− if (value & DRM_XE_MULTI_GROUP_KEEP_ACTIVE)
855− q->multi_queue.keep_active = true;
856−
857814 return 0;
858815 }
859816
@@ -1419,11 +1376,6 @@ void xe_exec_queue_kill(struct xe_exec_queue *q) · 559 unmodified lines
14191376
14201377 q->ops->kill(q);
14211378 xe_vm_remove_compute_exec_queue(q->vm, q);
1422−
1423− if (!xe_exec_queue_is_multi_queue_primary(q) && q->multi_queue.keep_active) {
1424− xe_exec_queue_group_kill_put(q->multi_queue.group);
1425− q->multi_queue.keep_active = false;
1426− }
14271379 }
14281380
14291381 int xe_exec_queue_destroy_ioctl(struct drm_device *dev, void *data,
@@ -1450,10 +1402,7 @@ int xe_exec_queue_destroy_ioctl(struct drm_device *dev, void *data, · 20 unmodified lines
14501402 if (q->vm && q->hwe->hw_engine_group)
14511403 xe_hw_engine_group_del_exec_queue(q->hwe->hw_engine_group, q);
14521404
1453− if (xe_exec_queue_is_multi_queue_primary(q))
1454− xe_exec_queue_group_kill_put(q->multi_queue.group);
1455− else
1456− xe_exec_queue_kill(q);
1405+ xe_exec_queue_kill(q);
14571406
14581407 trace_xe_exec_queue_close(q);
14591408 xe_exec_queue_put(q);
drivers/gpu/drm/xe/xe_exec_queue.h+0−2
@@ -113,8 +113,6 @@ static inline struct xe_exec_queue *xe_exec_queue_multi_queue_primary(struct xe_ · 112 unmodified lines
113113 return xe_exec_queue_is_multi_queue(q) ? q->multi_queue.group->primary : q;
114114 }
115115
116−void xe_exec_queue_group_kill_put(struct xe_exec_queue_group *group);
117−
118116 bool xe_exec_queue_is_lr(struct xe_exec_queue *q);
119117
120118 bool xe_exec_queue_is_idle(struct xe_exec_queue *q);
drivers/gpu/drm/xe/xe_exec_queue_types.h+0−4
@@ -62,8 +62,6 @@ struct xe_exec_queue_group { · 61 unmodified lines
6262 struct list_head list;
6363 /** @list_lock: Secondary queue list lock */
6464 struct mutex list_lock;
65− /** @kill_refcount: ref count to kill primary queue */
66− struct kref kill_refcount;
6765 /** @sync_pending: CGP_SYNC_DONE g2h response pending */
6866 bool sync_pending;
6967 /** @banned: Group banned */
@@ -163,8 +161,6 @@ struct xe_exec_queue { · 93 unmodified lines
163161 u8 valid:1;
164162 /** @multi_queue.is_primary: Is primary queue (Q0) of the group */
165163 u8 is_primary:1;
166− /** @multi_queue.keep_active: Keep the group active after primary is destroyed */
167− u8 keep_active:1;
168164 } multi_queue;
169165
170166 /** @sched_props: scheduling properties */
include/uapi/drm/xe_drm.h+0−4
@@ -1280,9 +1280,6 @@ struct drm_xe_vm_bind { · 1279 unmodified lines
12801280 * then a new multi-queue group is created with this queue as the primary queue
12811281 * (Q0). Otherwise, the queue gets added to the multi-queue group whose primary
12821282 * queue's exec_queue_id is specified in the lower 32 bits of the 'value' field.
1283− * If the extension's 'value' field has %DRM_XE_MULTI_GROUP_KEEP_ACTIVE flag
1284− * set, then the multi-queue group is kept active after the primary queue is
1285− * destroyed.
12861283 * All the other non-relevant bits of extension's 'value' field while adding the
12871284 * primary or the secondary queues of the group must be set to 0.
12881285 * - %DRM_XE_EXEC_QUEUE_SET_PROPERTY_MULTI_QUEUE_PRIORITY - Set the queue
@@ -1331,7 +1328,6 @@ struct drm_xe_exec_queue_create { · 42 unmodified lines
13311328 #define DRM_XE_EXEC_QUEUE_SET_HANG_REPLAY_STATE 3
13321329 #define DRM_XE_EXEC_QUEUE_SET_PROPERTY_MULTI_GROUP 4
13331330 #define DRM_XE_MULTI_GROUP_CREATE (1ull << 63)
1334−#define DRM_XE_MULTI_GROUP_KEEP_ACTIVE (1ull << 62)
13351331 #define DRM_XE_EXEC_QUEUE_SET_PROPERTY_MULTI_QUEUE_PRIORITY 5
13361332 /** @extensions: Pointer to the first extension struct, if any */
13371333 __u64 extensions;