[PATCH v2 2/5] drm/xe: Add exec_queue.sched_props.job_timeout_ms

Matthew Brost matthew.brost at intel.com
Thu Jan 4 16:44:39 UTC 2024


On Wed, Jan 03, 2024 at 10:44:05AM -0800, Brian Welty wrote:
> 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: Brian Welty <brian.welty at intel.com>

Reviewed-by: Matthew Brost <matthew.brost at intel.com>

> ---
>  drivers/gpu/drm/xe/xe_exec_queue.c       | 2 ++
>  drivers/gpu/drm/xe/xe_exec_queue_types.h | 2 ++
>  drivers/gpu/drm/xe/xe_guc_submit.c       | 2 +-
>  3 files changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_exec_queue.c b/drivers/gpu/drm/xe/xe_exec_queue.c
> index 94ae87540854..e78b13845417 100644
> --- a/drivers/gpu/drm/xe/xe_exec_queue.c
> +++ b/drivers/gpu/drm/xe/xe_exec_queue.c
> @@ -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.preempt_timeout_us =
>  				hwe->eclass->sched_props.preempt_timeout_us;
> +	q->sched_props.job_timeout_ms =
> +				hwe->eclass->sched_props.job_timeout_ms;
>  
>  	if (xe_exec_queue_is_parallel(q)) {
>  		q->parallel.composite_fence_ctx = dma_fence_context_alloc(1);
> diff --git a/drivers/gpu/drm/xe/xe_exec_queue_types.h b/drivers/gpu/drm/xe/xe_exec_queue_types.h
> index 3d7e704ec3d9..882eb5373980 100644
> --- a/drivers/gpu/drm/xe/xe_exec_queue_types.h
> +++ b/drivers/gpu/drm/xe/xe_exec_queue_types.h
> @@ -142,6 +142,8 @@ struct xe_exec_queue {
>  		u32 timeslice_us;
>  		/** @preempt_timeout_us: preemption timeout in micro-seconds */
>  		u32 preempt_timeout_us;
> +		/** @job_timeout_ms: job timeout in milliseconds */
> +		u32 job_timeout_ms;
>  	} sched_props;
>  
>  	/** @compute: compute exec queue state */
> diff --git a/drivers/gpu/drm/xe/xe_guc_submit.c b/drivers/gpu/drm/xe/xe_guc_submit.c
> index 21ac68e3246f..56c0a7bf554f 100644
> --- a/drivers/gpu/drm/xe/xe_guc_submit.c
> +++ b/drivers/gpu/drm/xe/xe_guc_submit.c
> @@ -1218,7 +1218,7 @@ static int guc_exec_queue_init(struct xe_exec_queue *q)
>  	init_waitqueue_head(&ge->suspend_wait);
>  
>  	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,
>  			    get_submit_wq(guc),
>  			    q->lrc[0].ring.size / MAX_JOB_SIZE_BYTES, 64,
> -- 
> 2.43.0
> 


More information about the Intel-xe mailing list