From: Matthew Brost <matthew.brost@intel.com>
To: Tejas Upadhyay <tejas.upadhyay@intel.com>
Cc: <intel-xe@lists.freedesktop.org>
Subject: Re: [PATCH] drm/xe: cancel pending job timer before freeing scheduler
Date: Mon, 24 Feb 2025 06:51:23 -0800 [thread overview]
Message-ID: <Z7yHa1C7VbKj8UtJ@lstrano-desk.jf.intel.com> (raw)
In-Reply-To: <20250224122237.576893-1-tejas.upadhyay@intel.com>
On Mon, Feb 24, 2025 at 05:52:37PM +0530, Tejas Upadhyay wrote:
> Async call to __guc_exec_queue_fini_async frees scheduler
> at the same time when some scheduler submission would have
> timed out and restarted. To handle such small window race
> case, all pending jobs timer should be cancelled before
> freeing scheduler.
>
> It will help to solve below which is not easily reproducible,
> https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/4223
I'd drop this part of the comment as it creates confusion as this patch
is not fixing the above issue.
>
> V2(MattB):
> - Cancel pending jobs before scheduler finish
>
> Signed-off-by: Tejas Upadhyay <tejas.upadhyay@intel.com>
> ---
> drivers/gpu/drm/xe/xe_guc_submit.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/gpu/drm/xe/xe_guc_submit.c b/drivers/gpu/drm/xe/xe_guc_submit.c
> index f2ce3086838c..8b7165d3820b 100644
> --- a/drivers/gpu/drm/xe/xe_guc_submit.c
> +++ b/drivers/gpu/drm/xe/xe_guc_submit.c
> @@ -1258,6 +1258,8 @@ static void __guc_exec_queue_fini_async(struct work_struct *w)
> cancel_work_sync(&ge->lr_tdr);
> release_guc_id(guc, q);
> xe_sched_entity_fini(&ge->entity);
> + /* Confirm no work left behind accessing device structures */
> + cancel_delayed_work_sync(&ge->sched.base.work_tdr);
Nit: I'd move this next 'cancel_work_sync(&ge->lr_tdr)' statement.
Matt
> xe_sched_fini(&ge->sched);
>
> kfree(ge);
> --
> 2.34.1
>
next prev parent reply other threads:[~2025-02-24 14:50 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-24 12:22 [PATCH] drm/xe: cancel pending job timer before freeing scheduler Tejas Upadhyay
2025-02-24 14:28 ` ✓ CI.Patch_applied: success for " Patchwork
2025-02-24 14:28 ` ✓ CI.checkpatch: " Patchwork
2025-02-24 14:30 ` ✓ CI.KUnit: " Patchwork
2025-02-24 14:46 ` ✓ CI.Build: " Patchwork
2025-02-24 14:48 ` ✓ CI.Hooks: " Patchwork
2025-02-24 14:50 ` ✓ CI.checksparse: " Patchwork
2025-02-24 14:51 ` Matthew Brost [this message]
2025-02-24 15:10 ` ✗ Xe.CI.BAT: failure " Patchwork
2025-02-24 16:26 ` ✗ 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=Z7yHa1C7VbKj8UtJ@lstrano-desk.jf.intel.com \
--to=matthew.brost@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=tejas.upadhyay@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