Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Mika Kuoppala <mika.kuoppala@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Subject: Re: [Intel-gfx] [PATCH] drm/i915/gt: Ignore error capturing a closed context
Date: Fri, 29 Jan 2021 17:01:35 +0200	[thread overview]
Message-ID: <87sg6j23e8.fsf@gaia.fi.intel.com> (raw)
In-Reply-To: <20210129120620.6516-1-chris@chris-wilson.co.uk>

Chris Wilson <chris@chris-wilson.co.uk> writes:

> To capture a context after a gpu hang, we suspend the request and then
> resume its execution afterwards. If the context is already closed, we
> can assume that no one is interested in the result, but instead we are
> trying to terminate execution quickly as part of a forced-preemption.
> In which case, do not waste time in suspending the request, capturing
> the error, and just cancel it instead.
>
> Testcase: igt/gem_ctx_persistence/many-contexts
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>

> ---
>  .../drm/i915/gt/intel_execlists_submission.c   | 18 +++++++++++++-----
>  1 file changed, 13 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/gt/intel_execlists_submission.c b/drivers/gpu/drm/i915/gt/intel_execlists_submission.c
> index e20ab2eab3a8..2280d1bd2c77 100644
> --- a/drivers/gpu/drm/i915/gt/intel_execlists_submission.c
> +++ b/drivers/gpu/drm/i915/gt/intel_execlists_submission.c
> @@ -2249,10 +2249,21 @@ static u32 active_ccid(struct intel_engine_cs *engine)
>  static void execlists_capture(struct intel_engine_cs *engine)
>  {
>  	struct execlists_capture *cap;
> +	struct i915_request *rq;
>  
>  	if (!IS_ENABLED(CONFIG_DRM_I915_CAPTURE_ERROR))
>  		return;
>  
> +	rq = active_context(engine, active_ccid(engine));
> +
> +	/*
> +	 * If the context is closed, assume no one is listening for the
> +	 * associated state; the user is already gone. We can save a lot of
> +	 * time around forced-preemption by just cancelling the guilty request.
> +	 */
> +	if (!rq || intel_context_is_closed(rq->context))
> +		return;
> +
>  	/*
>  	 * We need to _quickly_ capture the engine state before we reset.
>  	 * We are inside an atomic section (softirq) here and we are delaying
> @@ -2262,11 +2273,8 @@ static void execlists_capture(struct intel_engine_cs *engine)
>  	if (!cap)
>  		return;
>  
> -	cap->rq = active_context(engine, active_ccid(engine));
> -	if (cap->rq) {
> -		cap->rq = active_request(cap->rq->context->timeline, cap->rq);
> -		cap->rq = i915_request_get_rcu(cap->rq);
> -	}
> +	rq = active_request(rq->context->timeline, rq);
> +	cap->rq = i915_request_get_rcu(rq);
>  	if (!cap->rq)
>  		goto err_free;
>  
> -- 
> 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

  parent reply	other threads:[~2021-01-29 15:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-29 12:06 [Intel-gfx] [PATCH] drm/i915/gt: Ignore error capturing a closed context Chris Wilson
2021-01-29 12:07 ` Chris Wilson
2021-01-29 13:24 ` [Intel-gfx] ✓ Fi.CI.BAT: success for " Patchwork
2021-01-29 15:01 ` Mika Kuoppala [this message]
2021-01-29 18:43 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " 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=87sg6j23e8.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox