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/1] drm/xe/guc: Scale suspend wait timeout with preempt timeout
Date: Fri, 20 Nov 2026 17:20:53 +0000 [thread overview]
Message-ID: <c2a0f66e-f6f0-419d-8fa2-e10339808394@intel.com> (raw)
In-Reply-To: <20261120160826.2045426-2-himal.prasad.ghimiray@intel.com>
On 20/11/2026 16:08, 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.
>
> Signed-off-by: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
> ---
> drivers/gpu/drm/xe/xe_guc_submit.c | 20 ++++++++++++++++----
> 1 file changed, 16 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_guc_submit.c b/drivers/gpu/drm/xe/xe_guc_submit.c
> index 9e7c2778029c..0898ee29f460 100644
> --- a/drivers/gpu/drm/xe/xe_guc_submit.c
> +++ b/drivers/gpu/drm/xe/xe_guc_submit.c
> @@ -2532,8 +2532,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);
> + long timeout;
> int 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 +
> + usecs_to_jiffies(READ_ONCE(q->sched_props.preempt_timeout_us));
Does it makes sense to apply the preempt_timeout for
xe_exec_queue_is_multi_queue_secondary()? It sounds like in theory that
is more a sw thing wrt to completing the suspend/preempt? It rather
happens via primary?
> + 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
> * on the hardware, so exec_queue_killed() is what ends the wait in that
> @@ -2546,16 +2558,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))
prev parent reply other threads:[~2026-11-20 17:21 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-20 16:08 [PATCH 1/1] drm/xe/guc: Scale suspend wait timeout with preempt timeout Himal Prasad Ghimiray
2026-11-20 16:15 ` sashiko-bot
2026-11-20 16:16 ` ✓ CI.KUnit: success for series starting with [1/1] " Patchwork
2026-11-20 17:06 ` ✓ Xe.CI.BAT: " Patchwork
2026-11-20 17:20 ` Matthew Auld [this message]
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=c2a0f66e-f6f0-419d-8fa2-e10339808394@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.