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
Subject: Re: [PATCH 1/5] drm/i915/execlists: Refactor -EIO markup of hung requests
Date: Mon, 23 Sep 2019 10:47:18 +0300	[thread overview]
Message-ID: <87wodzzc6x.fsf@gaia.fi.intel.com> (raw)
In-Reply-To: <20190921095542.23205-1-chris@chris-wilson.co.uk>

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

> Pull setting -EIO on the hung requests into its own utility function.
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> ---
>  drivers/gpu/drm/i915/gt/intel_lrc.c | 32 +++++++++++++++--------------
>  1 file changed, 17 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/gt/intel_lrc.c b/drivers/gpu/drm/i915/gt/intel_lrc.c
> index 1a2b71157f08..53e823d36b28 100644
> --- a/drivers/gpu/drm/i915/gt/intel_lrc.c
> +++ b/drivers/gpu/drm/i915/gt/intel_lrc.c
> @@ -234,6 +234,13 @@ static void execlists_init_reg_state(u32 *reg_state,
>  				     struct intel_engine_cs *engine,
>  				     struct intel_ring *ring);
>  
> +static void mark_eio(struct i915_request *rq)
> +{
> +	if (!i915_request_signaled(rq))
> +		dma_fence_set_error(&rq->fence, -EIO);
> +	i915_request_mark_complete(rq);
> +}
> +
>  static inline u32 intel_hws_preempt_address(struct intel_engine_cs *engine)
>  {
>  	return (i915_ggtt_offset(engine->status_page.vma) +
> @@ -2501,12 +2508,8 @@ static void execlists_cancel_requests(struct intel_engine_cs *engine)
>  	__execlists_reset(engine, true);
>  
>  	/* Mark all executing requests as skipped. */
> -	list_for_each_entry(rq, &engine->active.requests, sched.link) {
> -		if (!i915_request_signaled(rq))
> -			dma_fence_set_error(&rq->fence, -EIO);
> -
> -		i915_request_mark_complete(rq);
> -	}
> +	list_for_each_entry(rq, &engine->active.requests, sched.link)
> +		mark_eio(rq);
>  
>  	/* Flush the queued requests to the timeline list (for retiring). */
>  	while ((rb = rb_first_cached(&execlists->queue))) {
> @@ -2514,10 +2517,8 @@ static void execlists_cancel_requests(struct intel_engine_cs *engine)
>  		int i;
>  
>  		priolist_for_each_request_consume(rq, rn, p, i) {
> -			list_del_init(&rq->sched.link);
> +			mark_eio(rq);
>  			__i915_request_submit(rq);
> -			dma_fence_set_error(&rq->fence, -EIO);
> -			i915_request_mark_complete(rq);

Now we marek complete before submitting. Does that bring problems?

-Mika


>  		}
>  
>  		rb_erase_cached(&p->node, &execlists->queue);
> @@ -2533,13 +2534,14 @@ static void execlists_cancel_requests(struct intel_engine_cs *engine)
>  		RB_CLEAR_NODE(rb);
>  
>  		spin_lock(&ve->base.active.lock);
> -		if (ve->request) {
> -			ve->request->engine = engine;
> -			__i915_request_submit(ve->request);
> -			dma_fence_set_error(&ve->request->fence, -EIO);
> -			i915_request_mark_complete(ve->request);
> +		rq = fetch_and_zero(&ve->request);
> +		if (rq) {
> +			mark_eio(rq);
> +
> +			rq->engine = engine;
> +			__i915_request_submit(rq);
> +
>  			ve->base.execlists.queue_priority_hint = INT_MIN;
> -			ve->request = NULL;
>  		}
>  		spin_unlock(&ve->base.active.lock);
>  	}
> -- 
> 2.23.0
>
> _______________________________________________
> 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:[~2019-09-23  7:47 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-21  9:55 [PATCH 1/5] drm/i915/execlists: Refactor -EIO markup of hung requests Chris Wilson
2019-09-21  9:55 ` [PATCH 2/5] drm/i915: Only enqueue already completed requests Chris Wilson
2019-09-23  9:51   ` Tvrtko Ursulin
2019-09-23 10:22     ` Chris Wilson
2019-09-23 10:32   ` [PATCH v2] " Chris Wilson
2019-09-23 10:44     ` Tvrtko Ursulin
2019-09-23 10:56       ` Chris Wilson
2019-09-21  9:55 ` [PATCH 3/5] drm/i915: Fixup preempt-to-busy vs resubmission of a virtual request Chris Wilson
2019-09-23 13:32   ` Tvrtko Ursulin
2019-09-23 13:39     ` Chris Wilson
2019-09-23 13:46       ` Chris Wilson
2019-09-23 13:58       ` Tvrtko Ursulin
2019-09-21  9:55 ` [PATCH 4/5] drm/i915: Fixup preempt-to-busy vs reset " Chris Wilson
2019-09-23 13:46   ` Tvrtko Ursulin
2019-09-23 13:57     ` Chris Wilson
2019-09-21  9:55 ` [PATCH 5/5] drm/i915: Prevent bonded requests from overtaking each other on preemption Chris Wilson
2019-09-23 13:48   ` Tvrtko Ursulin
2019-09-23 13:53     ` Chris Wilson
2019-09-22 12:13 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/5] drm/i915/execlists: Refactor -EIO markup of hung requests Patchwork
2019-09-22 12:35 ` ✓ Fi.CI.BAT: success " Patchwork
2019-09-23  0:20 ` ✗ Fi.CI.IGT: failure " Patchwork
2019-09-23  7:47 ` Mika Kuoppala [this message]
2019-09-23  8:01   ` [PATCH 1/5] " Chris Wilson
2019-09-23  9:27 ` Tvrtko Ursulin
2019-09-23  9:35   ` Chris Wilson
2019-09-23  9:54     ` Tvrtko Ursulin
2019-09-23 14:42 ` ✗ Fi.CI.BUILD: failure for series starting with [1/5] drm/i915/execlists: Refactor -EIO markup of hung requests (rev3) 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=87wodzzc6x.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