public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v3 3/5] drm/i915: Defer enabling hangcheck to the first fake breadcrumb interrupt
Date: Mon, 27 Feb 2017 10:15:56 +0000	[thread overview]
Message-ID: <f9863184-071a-68c7-d685-71f55f311a24@linux.intel.com> (raw)
In-Reply-To: <20170224180149.8737-3-chris@chris-wilson.co.uk>


On 24/02/2017 18:01, Chris Wilson wrote:
> By deferring hangcheck to the fake breadcrumb interrupt, we can simply
> the enabling procedure slightly - as by enabling the fake, we then
> enable the hangcheck. By always enabling the hangcheck from each fake
> interrupt (it will be a no-op for an already queued hangcheck), it will
> make restoring the breadcrumbs after a reset simpler in the next patch.
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/intel_breadcrumbs.c | 36 ++++++++++++++++----------------
>  1 file changed, 18 insertions(+), 18 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_breadcrumbs.c b/drivers/gpu/drm/i915/intel_breadcrumbs.c
> index ba5f72fb4890..d7511e89c8ab 100644
> --- a/drivers/gpu/drm/i915/intel_breadcrumbs.c
> +++ b/drivers/gpu/drm/i915/intel_breadcrumbs.c
> @@ -75,17 +75,6 @@ static void intel_breadcrumbs_hangcheck(unsigned long data)
>  	DRM_DEBUG("Hangcheck timer elapsed... %s idle\n", engine->name);
>  	set_bit(engine->id, &engine->i915->gpu_error.missed_irq_rings);
>  	mod_timer(&engine->breadcrumbs.fake_irq, jiffies + 1);
> -
> -	/* Ensure that even if the GPU hangs, we get woken up.
> -	 *
> -	 * However, note that if no one is waiting, we never notice
> -	 * a gpu hang. Eventually, we will have to wait for a resource
> -	 * held by the GPU and so trigger a hangcheck. In the most
> -	 * pathological case, this will be upon memory starvation! To
> -	 * prevent this, we also queue the hangcheck from the retire
> -	 * worker.
> -	 */
> -	i915_queue_hangcheck(engine->i915);
>  }
>
>  static void intel_breadcrumbs_fake_irq(unsigned long data)
> @@ -99,8 +88,21 @@ static void intel_breadcrumbs_fake_irq(unsigned long data)
>  	 * every jiffie in order to kick the oldest waiter to do the
>  	 * coherent seqno check.
>  	 */
> -	if (intel_engine_wakeup(engine))
> -		mod_timer(&engine->breadcrumbs.fake_irq, jiffies + 1);
> +	if (!intel_engine_wakeup(engine))
> +		return;
> +
> +	mod_timer(&engine->breadcrumbs.fake_irq, jiffies + 1);
> +
> +	/* Ensure that even if the GPU hangs, we get woken up.
> +	 *
> +	 * However, note that if no one is waiting, we never notice
> +	 * a gpu hang. Eventually, we will have to wait for a resource
> +	 * held by the GPU and so trigger a hangcheck. In the most
> +	 * pathological case, this will be upon memory starvation! To
> +	 * prevent this, we also queue the hangcheck from the retire
> +	 * worker.
> +	 */
> +	i915_queue_hangcheck(engine->i915);
>  }
>
>  static void irq_enable(struct intel_engine_cs *engine)
> @@ -179,13 +181,11 @@ static void __intel_breadcrumbs_enable_irq(struct intel_breadcrumbs *b)
>  		b->irq_enabled = true;
>  	}
>
> -	if (!b->irq_enabled || use_fake_irq(b)) {
> +	/* Ensure we never sleep indefinitely */
> +	if (!b->irq_enabled || use_fake_irq(b))
>  		mod_timer(&b->fake_irq, jiffies + 1);
> -		i915_queue_hangcheck(i915);
> -	} else {
> -		/* Ensure we never sleep indefinitely */
> +	else
>  		mod_timer(&b->hangcheck, wait_timeout());
> -	}
>  }
>
>  static void __intel_breadcrumbs_disable_irq(struct intel_breadcrumbs *b)
>

Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Regards,

Tvrtko

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2017-02-27 10:15 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-24 18:01 [PATCH v3 1/5] drm/i915: Report both waiters and success from intel_engine_wakeup() Chris Wilson
2017-02-24 18:01 ` [PATCH v3 2/5] drm/i915: Signal first fence from irq handler if complete Chris Wilson
2017-02-25 10:05   ` [PATCH v4] " Chris Wilson
2017-02-27 10:04     ` Tvrtko Ursulin
2017-02-24 18:01 ` [PATCH v3 3/5] drm/i915: Defer enabling hangcheck to the first fake breadcrumb interrupt Chris Wilson
2017-02-27 10:15   ` Tvrtko Ursulin [this message]
2017-02-24 18:01 ` [PATCH v3 4/5] drm/i915: Delay disabling the user interrupt for breadcrumbs Chris Wilson
2017-02-27 10:31   ` Tvrtko Ursulin
2017-02-27 11:02     ` Chris Wilson
2017-02-24 18:01 ` [PATCH v3 5/5] drm/i915: Simplify intel_engine_wakeup() Chris Wilson
2017-02-27 10:34   ` Tvrtko Ursulin
2017-02-24 18:52 ` ✗ Fi.CI.BAT: warning for series starting with [v3,1/5] drm/i915: Report both waiters and success from intel_engine_wakeup() Patchwork
2017-02-25 10:52 ` ✓ Fi.CI.BAT: success for series starting with [v3,1/5] drm/i915: Report both waiters and success from intel_engine_wakeup() (rev2) Patchwork
2017-02-27 10:03 ` [PATCH v3 1/5] drm/i915: Report both waiters and success from intel_engine_wakeup() Tvrtko Ursulin
2017-02-27 10:35   ` Chris Wilson

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=f9863184-071a-68c7-d685-71f55f311a24@linux.intel.com \
    --to=tvrtko.ursulin@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