Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Summers, Stuart" <stuart.summers@intel.com>
To: "Brost, Matthew" <matthew.brost@intel.com>
Cc: "intel-xe@lists.freedesktop.org" <intel-xe@lists.freedesktop.org>
Subject: Re: [PATCH 0/7] Fix a couple of wedge corner-case memory leaks
Date: Mon, 13 Oct 2025 21:48:04 +0000	[thread overview]
Message-ID: <8d6d05faa1559350a8f01b101d43df379657c324.camel@intel.com> (raw)
In-Reply-To: <1bfb886a6e891b249d754b8b0dbbc5be41594f9a.camel@intel.com>

On Mon, 2025-10-13 at 17:13 +0000, Summers, Stuart wrote:
> On Mon, 2025-10-13 at 10:04 -0700, Matthew Brost wrote:
> > On Mon, Oct 13, 2025 at 04:24:57PM +0000, Stuart Summers wrote:
> > > Most of the patches in this series are just adding
> > > some debug hints to help track these down. I split
> > > these up in case we want to pick and choose which ones
> > > to include in the tree. I found them useful.
> > > 
> > > The main two interesting patches are the last two in the
> > > series which are fixing some corner cases when the
> > > driver becomes wedged in the middle of either communication
> > > with the DRM scheduler or in the event the GuC becomes
> > > unresponsive. In both of these cases there is a chance
> > > we could leak memory around the exec queue members
> > > like the LRC and the LRC BO. These patches fix those
> > > scenarios.
> > > 
> > 
> > Ok, I think I see the problem. I believe the correct approach is:
> > 
> > - Apply [1]
> 
> I get the need for [1], but I don't think this is going to solve the
> issue I'm facing specifically since, in my case, GuC is alive at the
> time of schedule disable and becomes unresponsive only after that H2G
> is sent.
> 
> Basically I think there are a few things going on here.
> 
> I'm pulling [1] now though and I'll test and get back.

Yeah unfortunately this doesn't cover the case where we can submit to
GuC (GuC is alive on deregistration/schedule disable) but then GuC
stops responding before we get any of those responses back. We just
aren't tracking that. I still think the second patch in this series is
needed for that reason.

> 
> > 
> > - Ensure all schedulers are not stopped in guc_submit_wedged_fini
> > 
> > - Clean up any lost H2G in guc_submit_wedged_fini similar to a GT
> > reset
> > 
> > - Wait on all async scheduler work queue opertaions complete
> > somewhere
> >   (this is part of VLK-80263, I was going to try to look at this
> > part
> >   sometime this week). 
> 
> Oh thanks for the link here too! I'll see if this fits in to my
> scenario as well.

I did try adding a guc_sanitize() into the wedge_fini() function and it
isn't helping. I'm still debugging here though. I agree it seems like
we could use something there.

w.r.t. vlk-80263, we do already have a 5s wait on all exec queues to
clear there. I think this isn't the only issue though, although I
haven't looked through your vf case specifically there.

Thanks,
Stuart

> 
> Thanks,
> Stuart
> 
> > 
> > Matt
> > 
> > [1] https://patchwork.freedesktop.org/series/155417/
> > 
> > > v2: Address feedback from Matt:
> > >     - Let the DRM scheduler handle pausing/unpausing
> > >     - Still do the wait after scheduling disable/deregister
> > >       as with the previous patch, but skip the intermediate
> > >       software-based schedule disable using the "banned"
> > >       flag and instead just jump straight to the deregister
> > >       handling which will fully reset the queue state.
> > >       Note that for this case I am seeing a hardware failure
> > >       after submitting to GuC but before receiving the
> > >       response from GuC. So even if we wedge in this case
> > >       (monitoring the hardware state change), the queue
> > >       itself is not wedged because of the active GuC
> > >       submission (CT is not stalled at that point).
> > > 
> > > Stuart Summers (7):
> > >   drm/xe: Add additional trace points for LRCs
> > >   drm/xe: Add a trace point for VM close
> > >   drm/xe: Add the BO pointer info to the BO trace
> > >   drm/xe: Add new exec queue trace points
> > >   drm/xe: Correct migration VM teardown order
> > >   drm/xe: Don't block messages to the GPU scheduler
> > >   drm/xe: Check for GuC responses on disabling scheduling
> > > 
> > >  drivers/gpu/drm/xe/xe_exec_queue.c    |  4 +++
> > >  drivers/gpu/drm/xe/xe_gpu_scheduler.c |  6 +---
> > >  drivers/gpu/drm/xe/xe_guc_submit.c    | 24 ++++++++++++---
> > >  drivers/gpu/drm/xe/xe_lrc.c           |  4 +++
> > >  drivers/gpu/drm/xe/xe_lrc.h           |  3 ++
> > >  drivers/gpu/drm/xe/xe_migrate.c       |  2 +-
> > >  drivers/gpu/drm/xe/xe_trace.h         | 22 ++++++++++++--
> > >  drivers/gpu/drm/xe/xe_trace_bo.h      | 12 ++++++--
> > >  drivers/gpu/drm/xe/xe_trace_lrc.h     | 42
> > > ++++++++++++++++++++++++++-
> > >  drivers/gpu/drm/xe/xe_vm.c            |  2 ++
> > >  10 files changed, 106 insertions(+), 15 deletions(-)
> > > 
> > > -- 
> > > 2.34.1
> > > 
> 


  reply	other threads:[~2025-10-13 21:48 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-13 16:24 [PATCH 0/7] Fix a couple of wedge corner-case memory leaks Stuart Summers
2025-10-13 16:24 ` [PATCH 1/7] drm/xe: Add additional trace points for LRCs Stuart Summers
2025-10-13 16:24 ` [PATCH 2/7] drm/xe: Add a trace point for VM close Stuart Summers
2025-10-13 16:25 ` [PATCH 3/7] drm/xe: Add the BO pointer info to the BO trace Stuart Summers
2025-10-13 16:25 ` [PATCH 4/7] drm/xe: Add new exec queue trace points Stuart Summers
2025-10-13 16:25 ` [PATCH 5/7] drm/xe: Correct migration VM teardown order Stuart Summers
2025-10-13 16:25 ` [PATCH 6/7] drm/xe: Don't block messages to the GPU scheduler Stuart Summers
2025-10-13 16:56   ` Matthew Brost
2025-10-13 17:17     ` Summers, Stuart
2025-10-13 17:31       ` Matthew Brost
2025-10-13 17:38         ` Summers, Stuart
2025-10-13 21:49           ` Summers, Stuart
2025-10-13 16:25 ` [PATCH 7/7] drm/xe: Check for GuC responses on disabling scheduling Stuart Summers
2025-10-13 17:04 ` [PATCH 0/7] Fix a couple of wedge corner-case memory leaks Matthew Brost
2025-10-13 17:13   ` Summers, Stuart
2025-10-13 21:48     ` Summers, Stuart [this message]
2025-10-13 18:45 ` ✗ CI.checkpatch: warning for Fix a couple of wedge corner-case memory leaks (rev2) Patchwork
2025-10-13 18:46 ` ✓ CI.KUnit: success " Patchwork
2025-10-13 19:31 ` ✗ Xe.CI.BAT: failure " Patchwork
2025-10-13 23:13 ` ✗ Xe.CI.Full: " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2025-10-20 21:45 [PATCH 0/7] Fix a couple of wedge corner-case memory leaks Stuart Summers
2025-10-13 22:31 Stuart Summers
2025-10-02 23:04 Stuart Summers

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=8d6d05faa1559350a8f01b101d43df379657c324.camel@intel.com \
    --to=stuart.summers@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=matthew.brost@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