From: Daniel Vetter <daniel@ffwll.ch>
To: Chris Wilson <chris@chris-wilson.co.uk>,
Daniel Vetter <daniel@ffwll.ch>,
intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 02/13] drm/i915: Stop the machine whilst capturing the GPU crash dump
Date: Fri, 5 Aug 2016 21:57:03 +0200 [thread overview]
Message-ID: <20160805195703.GL6232@phenom.ffwll.local> (raw)
In-Reply-To: <20160805190158.GL24508@nuc-i3427.alporthouse.com>
On Fri, Aug 05, 2016 at 08:01:58PM +0100, Chris Wilson wrote:
> On Fri, Aug 05, 2016 at 08:50:11PM +0200, Daniel Vetter wrote:
> > On Fri, Aug 05, 2016 at 10:05:53AM +0100, Chris Wilson wrote:
> > > The error state is purposefully racy as we expect it to be called at any
> > > time and so have avoided any locking whilst capturing the crash dump.
> > > However, with multi-engine GPUs and multiple CPUs, those races can
> > > manifest into OOPSes as we attempt to chase dangling pointers freed on
> > > other CPUs. Under discussion are lots of ways to slow down normal
> > > operation in order to protect the post-mortem error capture, but what it
> > > we take the opposite approach and freeze the machine whilst the error
> > > capture runs (note the GPU may still running, but as long as we don't
> > > process any of the results the driver's bookkeeping will be static).
> > >
> > > Note that by of itself, this is not a complete fix. It also depends on
> > > the compiler barriers in list_add/list_del to prevent traversing the
> > > lists into the void.
> >
> > The other important bit I think are NULL checks. I think the commit
> > message should mention that too.
>
> Not so convinced here. My idea for GPU error capture is that we
> basically grab the bad request and then probe from there. The only list
> (and pointer chasing) I want to walk in a dangerous manner is the request
> list. Everything we need to report should be derivable from that
> request, and as the request is reachable from the list we know it is
> intact. I guess we could err on !request->fence.refcount and run away.
Yeah, this story is more convincing, would be good to add it.
-Daniel
>
> > > v2: Avoid drm_clflush_pages() inside stop_machine() as it may use
> > > stop_machine() itself for its wbinvd fallback.
> >
> > Droppingt he clflush from error capture seems like a pretty big
> > regression, at least at a glance. Why does this not result in piles of
> > corrupted error state captures?
>
> We replace the clflush with an ever bigger complete cache flush.
>
> However...
>
> > I guess since we need to flush on incoherent platforms before gpu access
> > anyway this is mostly true (as long as userspace doesn't do something
> > silly), but I think it should be captured in a comment at the place of the
> > clflush.
>
> Indeed. All the data we read has been flushed out of the cpu caches.
> If not, then right there is a reason for a hang. It's moot as I
> propose just using the GTT for accessing every page since it is the only
> universal method we have - and it has been my preference for GPU capture
> because it gives us coherent data as the GPU would see it. We only
> stopped doing so more recently when the batches were not accessible from
> the GTT.
> -Chris
>
> --
> Chris Wilson, Intel Open Source Technology Centre
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2016-08-05 19:57 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-05 9:05 First class i915_vma Chris Wilson
2016-08-05 9:05 ` [PATCH 01/13] drm/i915: Reduce amount of duplicate buffer information captured on error Chris Wilson
2016-08-05 9:05 ` [PATCH 02/13] drm/i915: Stop the machine whilst capturing the GPU crash dump Chris Wilson
2016-08-05 18:50 ` Daniel Vetter
2016-08-05 19:01 ` Chris Wilson
2016-08-05 19:57 ` Daniel Vetter [this message]
2016-08-05 9:05 ` [PATCH 03/13] drm/i915: Scan GGTT active list for context object Chris Wilson
2016-08-05 9:05 ` [PATCH 04/13] drm/i915: Move setting of request->batch into its single callsite Chris Wilson
2016-08-05 9:05 ` [PATCH 05/13] drm/i915: Mark unmappable GGTT entries as PIN_HIGH Chris Wilson
2016-08-05 9:05 ` [PATCH 06/13] drm/i915: Track pinned vma inside guc Chris Wilson
2016-08-05 9:05 ` [PATCH 07/13] drm/i915: Track pinned VMA Chris Wilson
2016-08-05 9:05 ` [PATCH 08/13] drm/i915/overlay: Use VMA as the primary tracker for images Chris Wilson
2016-08-05 9:06 ` [PATCH 09/13] drm/i915: Print the batchbuffer offset next to BBADDR in error state Chris Wilson
2016-08-05 9:06 ` [PATCH 10/13] drm/i915: Move per-request pid from request to ctx Chris Wilson
2016-08-05 9:06 ` [PATCH 11/13] drm/i915: Store the active context object on all engines upon error Chris Wilson
2016-08-05 9:06 ` [PATCH 12/13] drm/i915: Only record active and pending requests upon a GPU hang Chris Wilson
2016-08-05 9:06 ` [PATCH 13/13] drm/i915: Compress GPU objects in error state Chris Wilson
2016-08-05 18:56 ` Daniel Vetter
2016-08-05 19:15 ` Chris Wilson
2016-08-05 19:58 ` Daniel Vetter
2016-08-05 9:09 ` ✗ Ro.CI.BAT: failure for series starting with [01/13] drm/i915: Reduce amount of duplicate buffer information captured on error 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=20160805195703.GL6232@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=chris@chris-wilson.co.uk \
--cc=intel-gfx@lists.freedesktop.org \
/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