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] drm/i915: Only start with the fake-irq timer if interrupts are dead
Date: Fri, 17 Feb 2017 14:59:44 +0000	[thread overview]
Message-ID: <5ebf1a2b-5a06-ea03-ce04-7d7acaed36c9@linux.intel.com> (raw)
In-Reply-To: <20170217115539.26985-1-chris@chris-wilson.co.uk>


On 17/02/2017 11:55, Chris Wilson wrote:
> As a backup to waiting on a user-interrupt from the GPU, we use a heavy
> and frequent timer to wake up the waiting process should we detect an
> inconsistency whilst waiting. After seeing a "missed interrupt", the
> next time we wait, we restart the heavy timer. This patch is more
> reluctant to restart the timer and will only do so if we have not see any
> interrupts since when we started the fake irq timer. If we are seeing
> interrupts, then the waiters are being woken normally and we had an
> incoherency that caused to miss last time - that is unlikely to reoccur
> and so taking the risk of stalling again seems pragmatic.
>
> 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 | 20 ++++++++++++++++++--
>  1 file changed, 18 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_breadcrumbs.c b/drivers/gpu/drm/i915/intel_breadcrumbs.c
> index 83a8b67d6427..1719f9da13b8 100644
> --- a/drivers/gpu/drm/i915/intel_breadcrumbs.c
> +++ b/drivers/gpu/drm/i915/intel_breadcrumbs.c
> @@ -107,6 +107,23 @@ static void irq_disable(struct intel_engine_cs *engine)
>  	spin_unlock(&engine->i915->irq_lock);
>  }
>
> +static bool use_fake_irq(const struct intel_breadcrumbs *b)
> +{
> +	const struct intel_engine_cs *engine =
> +		container_of(b, struct intel_engine_cs, breadcrumbs);
> +
> +	if (!test_bit(engine->id, &engine->i915->gpu_error.missed_irq_rings))
> +		return false;
> +
> +	/* Only start with the heavy weight fake irq timer if we have not
> +	 * seen any interrupts since enabling it the first time. If the
> +	 * interrupts are still arriving, it means we made a mistake in our
> +	 * engine->seqno_barrier(), a timing error that should be transient
> +	 * and unlikely to reoccur.
> +	 */
> +	return atomic_read(&engine->irq_count) == b->hangcheck_interrupts;
> +}
> +
>  static void __intel_breadcrumbs_enable_irq(struct intel_breadcrumbs *b)
>  {
>  	struct intel_engine_cs *engine =
> @@ -145,8 +162,7 @@ static void __intel_breadcrumbs_enable_irq(struct intel_breadcrumbs *b)
>  		b->irq_enabled = true;
>  	}
>
> -	if (!b->irq_enabled ||
> -	    test_bit(engine->id, &i915->gpu_error.missed_irq_rings)) {
> +	if (!b->irq_enabled || use_fake_irq(b)) {
>  		mod_timer(&b->fake_irq, jiffies + 1);
>  		i915_queue_hangcheck(i915);
>  	} else {
>

Very soothing now that I have discovered the pre-existing behaviour. :)

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-17 14:59 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-17 10:18 [PATCH v2 1/3] drm/i915: Postpone fake breadcrumb interrupt until real interrupts cease Chris Wilson
2017-02-17 10:18 ` [PATCH v2 2/3] drm/i915: Break i915_spin_request() if we see an interrupt Chris Wilson
2017-02-17 10:18 ` [PATCH v2 3/3] drm/i915: Defer declaration of missed-interrupt until the waiter is asleep Chris Wilson
2017-02-17 10:48   ` Tvrtko Ursulin
2017-02-17 10:58     ` Chris Wilson
2017-02-17 11:33       ` Tvrtko Ursulin
2017-02-17 11:55         ` [PATCH] drm/i915: Only start with the fake-irq timer if interrupts are dead Chris Wilson
2017-02-17 14:59           ` Tvrtko Ursulin [this message]
2017-02-17 22:16             ` Chris Wilson
2017-02-17 11:35   ` [PATCH v2 3/3] drm/i915: Defer declaration of missed-interrupt until the waiter is asleep Mika Kuoppala
2017-02-17 11:43     ` Chris Wilson
2017-02-17 11:51       ` Chris Wilson
2017-02-17 12:00       ` Mika Kuoppala
2017-02-17 11:22 ` ✓ Fi.CI.BAT: success for series starting with [v2,1/3] drm/i915: Postpone fake breadcrumb interrupt until real interrupts cease Patchwork
2017-02-17 12:22 ` ✗ Fi.CI.BAT: warning for series starting with [v2,1/3] drm/i915: Postpone fake breadcrumb interrupt until real interrupts cease (rev2) 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=5ebf1a2b-5a06-ea03-ce04-7d7acaed36c9@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