All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Auld <matthew.auld@intel.com>
To: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>,
	intel-xe@lists.freedesktop.org
Cc: "Thomas Hellström" <thomas.hellstrom@linux.intel.com>,
	"Rodrigo Vivi" <rodrigo.vivi@intel.com>,
	"Matthew Brost" <matthew.brost@intel.com>
Subject: Re: [PATCH 1/2] drm/xe/guc: Scale suspend wait timeout with preempt timeout
Date: Mon, 23 Nov 2026 13:11:48 +0000	[thread overview]
Message-ID: <4ffe5baf-6ff6-4c61-a8bb-caf400900a8b@intel.com> (raw)
In-Reply-To: <20261123123436.2114961-3-himal.prasad.ghimiray@intel.com>

On 23/11/2026 12:34, Himal Prasad Ghimiray wrote:
> The suspend wait uses a fixed 5s timeout, but preempt_timeout_us can be
> set up to 10s via sysfs, causing queues to be banned while GuC is still
> legitimately preempting. Extend the timeout by preempt_timeout_us and
> min_run_period_ms.
> 
> v2:
> - Use long for ret to match wait_event_*_timeout() return type (Sashiko)
> - Skip preempt_timeout_us for multi-queue secondaries (Matt Auld)
> 
> Fixes: 627c961d672d ("drm/xe: Add timeout to preempt fences")
> Signed-off-by: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>

Reviewed-by: Matthew Auld <matthew.auld@intel.com>

> ---
>   drivers/gpu/drm/xe/xe_guc_submit.c | 23 ++++++++++++++++++-----
>   1 file changed, 18 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_guc_submit.c b/drivers/gpu/drm/xe/xe_guc_submit.c
> index 38069be11aa5..0e64b581f51a 100644
> --- a/drivers/gpu/drm/xe/xe_guc_submit.c
> +++ b/drivers/gpu/drm/xe/xe_guc_submit.c
> @@ -2569,7 +2569,20 @@ static int guc_exec_queue_wait_suspend_done(struct xe_exec_queue *q, bool blocki
>   {
>   	struct xe_guc *guc = exec_queue_to_guc(q);
>   	struct xe_device *xe = guc_to_xe(guc);
> -	int ret;
> +	long timeout;
> +	long ret;
> +
> +	/*
> +	 * The SUSPEND worker may sleep up to min_run_period_ms before disabling,
> +	 * and GuC may then take up to preempt_timeout_us (sysfs tunable up to
> +	 * XE_HW_ENGINE_PREEMPT_TIMEOUT_MAX) to preempt the context. Keep the
> +	 * historical 5s as slack on top of both.
> +	 */
> +	timeout = HZ * 5;
> +	if (!xe_exec_queue_is_multi_queue_secondary(q))
> +		timeout += usecs_to_jiffies(READ_ONCE(q->sched_props.preempt_timeout_us));
> +	if (q->vm)
> +		timeout += msecs_to_jiffies(q->vm->preempt.min_run_period_ms);
>   
>   	/*
>   	 * A kill does not clear suspend_pending, the queue may still be running
> @@ -2583,16 +2596,16 @@ static int guc_exec_queue_wait_suspend_done(struct xe_exec_queue *q, bool blocki
>   retry:
>   	if (blocking) {
>   		if (IS_SRIOV_VF(xe))
> -			ret = wait_event_timeout(guc->ct.wq, WAIT_COND, HZ * 5);
> +			ret = wait_event_timeout(guc->ct.wq, WAIT_COND, timeout);
>   		else
>   			ret = wait_event_timeout(q->guc->suspend_wait, WAIT_COND,
> -						 HZ * 5);
> +						 timeout);
>   	} else if (IS_SRIOV_VF(xe)) {
>   		ret = wait_event_interruptible_timeout(guc->ct.wq, WAIT_COND ||
> -						       vf_recovery(guc), HZ * 5);
> +						       vf_recovery(guc), timeout);
>   	} else {
>   		ret = wait_event_interruptible_timeout(q->guc->suspend_wait,
> -						       WAIT_COND, HZ * 5);
> +						       WAIT_COND, timeout);
>   	}
>   
>   	if (!blocking && vf_recovery(guc) && !xe_wedged(xe))


  parent reply	other threads:[~2026-11-23 13:12 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-23 12:34 [PATCH 1/2] drm/xe/guc: Scale suspend wait timeout with preempt timeout Himal Prasad Ghimiray
2026-11-23 12:34 ` [PATCH 2/2] drm/xe/cri: Increase default CCS preempt timeout to 7.5s Himal Prasad Ghimiray
2026-11-24 11:38   ` Matthew Auld
2026-12-01  0:19   ` Matt Roper
2026-11-23 12:38 ` [PATCH 1/2] drm/xe/guc: Scale suspend wait timeout with preempt timeout sashiko-bot
2026-11-23 13:11 ` Matthew Auld [this message]
2026-11-23 14:46 ` ✗ CI.KUnit: failure for series starting with [1/2] " Patchwork
2026-11-26 12:01 ` ✓ CI.KUnit: success for series starting with [1/2] drm/xe/guc: Scale suspend wait timeout with preempt timeout (rev2) Patchwork
2026-11-26 12:41 ` ✓ Xe.CI.BAT: " Patchwork
2026-11-26 18:29 ` ✓ Xe.CI.FULL: " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4ffe5baf-6ff6-4c61-a8bb-caf400900a8b@intel.com \
    --to=matthew.auld@intel.com \
    --cc=himal.prasad.ghimiray@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=matthew.brost@intel.com \
    --cc=rodrigo.vivi@intel.com \
    --cc=thomas.hellstrom@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.