From: Daniel Vetter <daniel@ffwll.ch>
To: Chris Wilson <chris@chris-wilson.co.uk>,
Daniel Vetter <daniel.vetter@ffwll.ch>,
Intel Graphics Development <intel-gfx@lists.freedesktop.org>,
"Goel, Akash" <akash.goel@intel.com>,
Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Subject: Re: [PATCH] drm/i915: Prevent oops on req->engine in rcu-protected peeking
Date: Fri, 5 Aug 2016 21:24:35 +0200 [thread overview]
Message-ID: <20160805192435.GK6232@phenom.ffwll.local> (raw)
In-Reply-To: <20160805173813.GI24508@nuc-i3427.alporthouse.com>
On Fri, Aug 05, 2016 at 06:38:13PM +0100, Chris Wilson wrote:
> On Fri, Aug 05, 2016 at 06:37:00PM +0200, Daniel Vetter wrote:
> > When only rcu-protected we might peek at a reinitializing request.
> > Prevent carnage by making sure we don't accidentally chase a NULL
> > pointer.
> >
> > The proper fix for this is to drop the memset (with kzalloc) in the
> > request allocation function, since that avoids both the NULL check in
> > these fastpaths and makes request allocation a notch lighter. But it
> > also means we need to careful audit all the paths to make sure nothing
> > gets upset and runs into garbage. And that's a bit much on a late Friday
> > with Joonas already on w/e. Also, today is drm-intel-next tag day, and
> > this will be the tag for the first 4.9 pull request.
> >
> > Hence this easier to review interim fix, which will be replaced early next
> > week by the proper fix Chris is working on.
> >
> > Fixes: 0eafec6d3244 ("drm/i915: Enable lockless lookup of request...")
> > Cc: Chris Wilson <chris@chris-wilson.co.uk>
> > Cc: "Goel, Akash" <akash.goel@intel.com>
> > Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> > Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> > Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
>
> This is not complete either since we do RCU lookups elsewhere as well.
Hunting throughout the code, the only other place I've found is in
i915_gpu_error.c. Only __active_get_engine_id looks at req->engine, and it
already has a NULL check.
I know that there's plenty of your patches pending which will add tons of
lockless request lockups, but I think for a short-term fix over the w/e
this is fine. Is there another place I've missed.
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
--
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:24 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-05 16:37 [PATCH] drm/i915: Prevent oops on req->engine in rcu-protected peeking Daniel Vetter
2016-08-05 17:38 ` Chris Wilson
2016-08-05 19:24 ` Daniel Vetter [this message]
2016-08-06 6:50 ` ✗ Ro.CI.BAT: failure for " 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=20160805192435.GK6232@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=akash.goel@intel.com \
--cc=chris@chris-wilson.co.uk \
--cc=daniel.vetter@ffwll.ch \
--cc=intel-gfx@lists.freedesktop.org \
--cc=joonas.lahtinen@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox