From: Matthew Brost <matthew.brost@intel.com>
To: Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>
Cc: <intel-xe@lists.freedesktop.org>
Subject: Re: [PATCH v2 1/4] drm/xe: split VF pause into prepare and revert phases
Date: Mon, 3 Aug 2026 09:55:19 -0700 [thread overview]
Message-ID: <anDH917vEbbhdwQD@gsse-cloud1.jf.intel.com> (raw)
In-Reply-To: <20260731232625.3313657-7-niranjana.vishwanathapura@intel.com>
On Fri, Jul 31, 2026 at 04:26:24PM -0700, Niranjana Vishwanathapura wrote:
> Extract xe_sched_submission_stop() + cancel_delayed_work_sync() into a
> new guc_exec_queue_pause_prepare() helper, then call it in a first pass
> over all queues before the existing revert loop in
> xe_guc_submit_pause_vf().
>
> In a multi-queue group a secondary's run_job() can register the primary
> queue, which must not race an in-progress revert of a sibling queue.
> Stopping every scheduler before reverting any queue prevents that race.
>
> No functional change outside the VF migration path.
>
> Assisted-by: Github-Copilot:Claude-opus-4.8
> Signed-off-by: Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>
Reviewed-by: Matthew Brost <matthew.brost@intel.com>
> ---
> drivers/gpu/drm/xe/xe_guc_submit.c | 26 +++++++++++++++++++++++---
> 1 file changed, 23 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_guc_submit.c b/drivers/gpu/drm/xe/xe_guc_submit.c
> index 8aaed4fd13ea..314747336fb9 100644
> --- a/drivers/gpu/drm/xe/xe_guc_submit.c
> +++ b/drivers/gpu/drm/xe/xe_guc_submit.c
> @@ -2737,17 +2737,24 @@ static void lrc_parallel_clear(struct xe_lrc *lrc)
> * during VF resume flows. The function scans the queue state, make adjustments
> * as needed, and queues jobs / messages which replayed upon unpause.
> */
> -static void guc_exec_queue_pause(struct xe_guc *guc, struct xe_exec_queue *q)
> +static void guc_exec_queue_pause_prepare(struct xe_guc *guc, struct xe_exec_queue *q)
> {
> struct xe_gpu_scheduler *sched = &q->guc->sched;
> - struct xe_sched_job *job;
> - int i;
>
> lockdep_assert_held(&guc->submission_state.lock);
>
> /* Stop scheduling + flush any DRM scheduler operations */
> xe_sched_submission_stop(sched);
> cancel_delayed_work_sync(&sched->base.work_tdr);
> +}
> +
> +static void guc_exec_queue_pause(struct xe_guc *guc, struct xe_exec_queue *q)
> +{
> + struct xe_gpu_scheduler *sched = &q->guc->sched;
> + struct xe_sched_job *job;
> + int i;
> +
> + lockdep_assert_held(&guc->submission_state.lock);
>
> guc_exec_queue_revert_pending_state_change(guc, q);
>
> @@ -2806,6 +2813,19 @@ void xe_guc_submit_pause_vf(struct xe_guc *guc)
> xe_gt_assert(guc_to_gt(guc), vf_recovery(guc));
>
> mutex_lock(&guc->submission_state.lock);
> + /*
> + * Stop all schedulers before reverting any queue: in a multi-queue
> + * group a secondary's run_job() can register the primary, which must
> + * not race an in-progress revert.
> + */
> + xa_for_each(&guc->submission_state.exec_queue_lookup, index, q) {
> + /* Prevent redundant attempts to stop parallel queues */
> + if (q->guc->id != index)
> + continue;
> +
> + guc_exec_queue_pause_prepare(guc, q);
> + }
> +
> xa_for_each(&guc->submission_state.exec_queue_lookup, index, q) {
> /* Prevent redundant attempts to stop parallel queues */
> if (q->guc->id != index)
> --
> 2.43.0
>
next prev parent reply other threads:[~2026-08-03 16:55 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-31 23:26 [PATCH v2 0/4] drm/xe/multi_queue: Handle lost message during VF migration Niranjana Vishwanathapura
2026-07-31 23:26 ` [PATCH v2 1/4] drm/xe: split VF pause into prepare and revert phases Niranjana Vishwanathapura
2026-08-03 16:55 ` Matthew Brost [this message]
2026-07-31 23:26 ` [PATCH v2 2/4] drm/xe/multi_queue: handle CGP_SYNC wait timeout during VF recovery Niranjana Vishwanathapura
2026-08-03 17:06 ` Matthew Brost
2026-07-31 23:26 ` [PATCH v2 3/4] drm/xe/multi_queue: track and recover lost CGP updates across VF migration Niranjana Vishwanathapura
2026-08-03 19:19 ` Matthew Brost
2026-07-31 23:26 ` [PATCH v2 4/4] drm/xe/multi_queue: replay dynamic CGP updates lost during " Niranjana Vishwanathapura
2026-08-03 19:20 ` Matthew Brost
2026-07-31 23:33 ` ✓ CI.KUnit: success for drm/xe/multi_queue: Handle lost message during VF migration (rev3) Patchwork
2026-08-01 0:25 ` ✓ Xe.CI.BAT: " Patchwork
2026-08-01 1:08 ` ✓ 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=anDH917vEbbhdwQD@gsse-cloud1.jf.intel.com \
--to=matthew.brost@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=niranjana.vishwanathapura@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox