From: Mika Kuoppala <mika.kuoppala@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915: Defer application of request banning to submission
Date: Fri, 15 Feb 2019 14:52:06 +0200 [thread overview]
Message-ID: <87k1i1z021.fsf@gaia.fi.intel.com> (raw)
In-Reply-To: <20190213182737.12695-1-chris@chris-wilson.co.uk>
Chris Wilson <chris@chris-wilson.co.uk> writes:
> As we currently do not check on submission whether the context is banned
> in a timely manner it is possible for some requests to escape
> cancellation after their parent context is banned. By moving the ban
> into the request submission under the engine->timeline.lock, we
> serialise it with the reset and setting of the context ban.
>
> References: eb8d0f5af4ec ("drm/i915: Remove GPU reset dependence on struct_mutex")
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Mika Kuoppala <mika.kuoppala@intel.com>
> ---
> drivers/gpu/drm/i915/i915_request.c | 3 +++
> drivers/gpu/drm/i915/i915_reset.c | 19 +++++--------------
> 2 files changed, 8 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_request.c b/drivers/gpu/drm/i915/i915_request.c
> index 0acd6baa3c88..5ab4e1c01618 100644
> --- a/drivers/gpu/drm/i915/i915_request.c
> +++ b/drivers/gpu/drm/i915/i915_request.c
> @@ -366,6 +366,9 @@ void __i915_request_submit(struct i915_request *request)
> GEM_BUG_ON(!irqs_disabled());
> lockdep_assert_held(&engine->timeline.lock);
>
> + if (i915_gem_context_is_banned(request->gem_context))
> + i915_request_skip(request, -EIO);
> +
> GEM_BUG_ON(request->global_seqno);
>
> seqno = next_global_seqno(&engine->timeline);
> diff --git a/drivers/gpu/drm/i915/i915_reset.c b/drivers/gpu/drm/i915/i915_reset.c
> index 12e74decd7a2..7fa97ce19bfd 100644
> --- a/drivers/gpu/drm/i915/i915_reset.c
> +++ b/drivers/gpu/drm/i915/i915_reset.c
> @@ -22,24 +22,15 @@ static void engine_skip_context(struct i915_request *rq)
> {
> struct intel_engine_cs *engine = rq->engine;
> struct i915_gem_context *hung_ctx = rq->gem_context;
> - struct i915_timeline *timeline = rq->timeline;
>
> lockdep_assert_held(&engine->timeline.lock);
This was golden.
> - GEM_BUG_ON(timeline == &engine->timeline);
>
> - spin_lock(&timeline->lock);
> -
> - if (i915_request_is_active(rq)) {
> - list_for_each_entry_continue(rq,
> - &engine->timeline.requests, link)
> - if (rq->gem_context == hung_ctx)
> - i915_request_skip(rq, -EIO);
> - }
> -
> - list_for_each_entry(rq, &timeline->requests, link)
> - i915_request_skip(rq, -EIO);
> + if (!i915_request_is_active(rq))
> + return;
Only thing that got me actually pondering was that
we don't flush anything after we have modify the ring.
But that is not about this patch
Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
>
> - spin_unlock(&timeline->lock);
> + list_for_each_entry_continue(rq, &engine->timeline.requests, link)
> + if (rq->gem_context == hung_ctx)
> + i915_request_skip(rq, -EIO);
> }
>
> static void client_mark_guilty(struct drm_i915_file_private *file_priv,
> --
> 2.20.1
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2019-02-15 12:52 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-13 18:24 [PATCH] drm/i915: Defer application of request banning to submission Chris Wilson
2019-02-13 18:27 ` Chris Wilson
2019-02-15 12:52 ` Mika Kuoppala [this message]
2019-02-15 12:57 ` Chris Wilson
2019-02-14 13:10 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Defer application of request banning to submission (rev2) Patchwork
2019-02-14 13:34 ` ✓ Fi.CI.BAT: success " Patchwork
2019-02-14 17:46 ` ✓ Fi.CI.IGT: " 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=87k1i1z021.fsf@gaia.fi.intel.com \
--to=mika.kuoppala@linux.intel.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.