Commit 6ae24344 authored by Brian Welty's avatar Brian Welty Committed by Matthew Brost

drm/xe: Add exec_queue.sched_props.job_timeout_ms

The purpose here is to allow to optimize exec_queue_set_job_timeout()
in follow-on patch.  Currently it does q->ops->set_job_timeout(...).
But we'd like to apply exec_queue_user_extensions much earlier and
q->ops cannot be called before __xe_exec_queue_init().

It will be much more efficient to instead only have to set
q->sched_props.job_timeout_ms when applying user extensions. That value
will then be used during q->ops->init().
Signed-off-by: default avatarBrian Welty <brian.welty@intel.com>
Signed-off-by: default avatarMatthew Brost <matthew.brost@intel.com>
Reviewed-by: default avatarMatthew Brost <matthew.brost@intel.com>
parent 6e144a7d
...@@ -65,6 +65,8 @@ static struct xe_exec_queue *__xe_exec_queue_alloc(struct xe_device *xe, ...@@ -65,6 +65,8 @@ static struct xe_exec_queue *__xe_exec_queue_alloc(struct xe_device *xe,
q->sched_props.timeslice_us = hwe->eclass->sched_props.timeslice_us; q->sched_props.timeslice_us = hwe->eclass->sched_props.timeslice_us;
q->sched_props.preempt_timeout_us = q->sched_props.preempt_timeout_us =
hwe->eclass->sched_props.preempt_timeout_us; hwe->eclass->sched_props.preempt_timeout_us;
q->sched_props.job_timeout_ms =
hwe->eclass->sched_props.job_timeout_ms;
if (q->flags & EXEC_QUEUE_FLAG_KERNEL && if (q->flags & EXEC_QUEUE_FLAG_KERNEL &&
q->flags & EXEC_QUEUE_FLAG_HIGH_PRIORITY) q->flags & EXEC_QUEUE_FLAG_HIGH_PRIORITY)
q->sched_props.priority = XE_EXEC_QUEUE_PRIORITY_KERNEL; q->sched_props.priority = XE_EXEC_QUEUE_PRIORITY_KERNEL;
......
...@@ -142,6 +142,8 @@ struct xe_exec_queue { ...@@ -142,6 +142,8 @@ struct xe_exec_queue {
u32 timeslice_us; u32 timeslice_us;
/** @preempt_timeout_us: preemption timeout in micro-seconds */ /** @preempt_timeout_us: preemption timeout in micro-seconds */
u32 preempt_timeout_us; u32 preempt_timeout_us;
/** @job_timeout_ms: job timeout in milliseconds */
u32 job_timeout_ms;
/** @priority: priority of this exec queue */ /** @priority: priority of this exec queue */
enum xe_exec_queue_priority priority; enum xe_exec_queue_priority priority;
} sched_props; } sched_props;
......
...@@ -1218,7 +1218,7 @@ static int guc_exec_queue_init(struct xe_exec_queue *q) ...@@ -1218,7 +1218,7 @@ static int guc_exec_queue_init(struct xe_exec_queue *q)
init_waitqueue_head(&ge->suspend_wait); init_waitqueue_head(&ge->suspend_wait);
timeout = (q->vm && xe_vm_in_lr_mode(q->vm)) ? MAX_SCHEDULE_TIMEOUT : timeout = (q->vm && xe_vm_in_lr_mode(q->vm)) ? MAX_SCHEDULE_TIMEOUT :
q->hwe->eclass->sched_props.job_timeout_ms; q->sched_props.job_timeout_ms;
err = xe_sched_init(&ge->sched, &drm_sched_ops, &xe_sched_ops, err = xe_sched_init(&ge->sched, &drm_sched_ops, &xe_sched_ops,
get_submit_wq(guc), get_submit_wq(guc),
q->lrc[0].ring.size / MAX_JOB_SIZE_BYTES, 64, q->lrc[0].ring.size / MAX_JOB_SIZE_BYTES, 64,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment