From: Mika Kuoppala <mika.kuoppala@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 06/18] drm/i915/breadcrumbs: Keep the fake irq armed across reset
Date: Mon, 23 Apr 2018 16:03:02 +0300 [thread overview]
Message-ID: <878t9e13eh.fsf@gaia.fi.intel.com> (raw)
In-Reply-To: <20180409111413.6352-7-chris@chris-wilson.co.uk>
Chris Wilson <chris@chris-wilson.co.uk> writes:
> Instead of synchronously cancelling the timer and re-enabling it inside
> the reset callbacks, keep the timer enabled and let it die on its next
> wakeup if no longer required. This allows
> intel_engine_reset_breadcrumbs() to be used from an atomic
> (timer/softirq) context such as required for resetting an engine.
>
> It also allows us to react better to the user poking around debugfs for
> testing missed irqs.
>
> 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 | 27 +++++++++++++++++-------
> 1 file changed, 19 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_breadcrumbs.c b/drivers/gpu/drm/i915/intel_breadcrumbs.c
> index 671a6d61e29d..0a2128c6b418 100644
> --- a/drivers/gpu/drm/i915/intel_breadcrumbs.c
> +++ b/drivers/gpu/drm/i915/intel_breadcrumbs.c
> @@ -130,11 +130,12 @@ static void intel_breadcrumbs_hangcheck(struct timer_list *t)
>
> static void intel_breadcrumbs_fake_irq(struct timer_list *t)
> {
> - struct intel_engine_cs *engine = from_timer(engine, t,
> - breadcrumbs.fake_irq);
> + struct intel_engine_cs *engine =
> + from_timer(engine, t, breadcrumbs.fake_irq);
> struct intel_breadcrumbs *b = &engine->breadcrumbs;
>
> - /* The timer persists in case we cannot enable interrupts,
> + /*
> + * The timer persists in case we cannot enable interrupts,
> * or if we have previously seen seqno/interrupt incoherency
> * ("missed interrupt" syndrome, better known as a "missed breadcrumb").
> * Here the worker will wake up every jiffie in order to kick the
> @@ -148,6 +149,12 @@ static void intel_breadcrumbs_fake_irq(struct timer_list *t)
> if (!b->irq_armed)
> return;
>
> + /* If the user has disabled the fake-irq, restore the hangchecking */
> + if (!test_bit(engine->id, &engine->i915->gpu_error.missed_irq_rings)) {
> + mod_timer(&b->hangcheck, wait_timeout());
> + return;
> + }
> +
Looking at the cancel_fake_irq() now, which we still need to keep as
sync, I think there is race introduce now as this can queue itself.
I think we want to also change the cancel_fake_irq() to do
the bit clearing first, not last after the del_timer_syncs().
-Mika
> mod_timer(&b->fake_irq, jiffies + 1);
> }
>
> @@ -840,15 +847,22 @@ void intel_engine_reset_breadcrumbs(struct intel_engine_cs *engine)
> {
> struct intel_breadcrumbs *b = &engine->breadcrumbs;
>
> - cancel_fake_irq(engine);
> spin_lock_irq(&b->irq_lock);
>
> + /*
> + * Leave the fake_irq timer enabled (if it is running), but clear the
> + * bit so that it turns itself off on its next wake up and goes back
> + * to the long hangcheck interval if still required.
> + */
> + clear_bit(engine->id, &engine->i915->gpu_error.missed_irq_rings);
> +
> if (b->irq_enabled)
> irq_enable(engine);
> else
> irq_disable(engine);
>
> - /* We set the IRQ_BREADCRUMB bit when we enable the irq presuming the
> + /*
> + * We set the IRQ_BREADCRUMB bit when we enable the irq presuming the
> * GPU is active and may have already executed the MI_USER_INTERRUPT
> * before the CPU is ready to receive. However, the engine is currently
> * idle (we haven't started it yet), there is no possibility for a
> @@ -857,9 +871,6 @@ void intel_engine_reset_breadcrumbs(struct intel_engine_cs *engine)
> */
> clear_bit(ENGINE_IRQ_BREADCRUMB, &engine->irq_posted);
>
> - if (b->irq_armed)
> - enable_fake_irq(b);
> -
> spin_unlock_irq(&b->irq_lock);
> }
>
> --
> 2.17.0
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2018-04-23 13:03 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-09 11:13 Still trying for context->preempt_timeout Chris Wilson
2018-04-09 11:13 ` [PATCH 01/18] drm/i915/execlists: Set queue priority from secondary port Chris Wilson
2018-04-10 14:05 ` Tvrtko Ursulin
[not found] ` <152337025293.3167.10189866034675290387@mail.alporthouse.com>
2018-04-10 14:42 ` Tvrtko Ursulin
2018-04-10 14:56 ` Chris Wilson
2018-04-10 15:08 ` Chris Wilson
[not found] ` <87af1b35-ba87-f560-c911-0e758a164909@linux.intel.com>
[not found] ` <152344296759.13225.4187833354912190018@mail.alporthouse.com>
[not found] ` <aa0e24bb-045c-e1c9-24bc-6dba0b4a28b8@linux.intel.com>
2018-04-11 11:33 ` Chris Wilson
2018-04-09 11:13 ` [PATCH 02/18] drm/i915/execlists: Refactor out complete_preempt_context() Chris Wilson
2018-04-09 11:13 ` [PATCH 03/18] drm/i915: Move engine reset prepare/finish to backends Chris Wilson
2018-04-09 11:13 ` [PATCH 04/18] drm/i915: Split execlists/guc reset preparations Chris Wilson
2018-04-09 11:14 ` [PATCH 05/18] drm/i915/execlists: Flush pending preemption events during reset Chris Wilson
2018-04-09 11:14 ` [PATCH 06/18] drm/i915/breadcrumbs: Keep the fake irq armed across reset Chris Wilson
2018-04-23 13:03 ` Mika Kuoppala [this message]
2018-04-23 14:53 ` Chris Wilson
2018-04-24 11:06 ` Mika Kuoppala
2018-04-09 11:14 ` [PATCH 07/18] drm/i915: Combine tasklet_kill and tasklet_disable Chris Wilson
2018-04-24 12:26 ` Mika Kuoppala
2018-04-24 12:28 ` Chris Wilson
2018-04-26 10:19 ` Mika Kuoppala
2018-04-26 10:26 ` Chris Wilson
2018-04-09 11:14 ` [PATCH 08/18] drm/i915: Stop parking the signaler around reset Chris Wilson
2018-04-09 11:14 ` [PATCH 09/18] drm/i915: Be irqsafe inside reset Chris Wilson
2018-04-09 11:14 ` [PATCH 10/18] drm/i915/execlists: Make submission tasklet hardirq safe Chris Wilson
2018-04-09 11:14 ` [PATCH 11/18] drm/i915/guc: " Chris Wilson
2018-04-09 11:14 ` [PATCH 12/18] drm/i915: Allow init_breadcrumbs to be used from irq context Chris Wilson
2018-04-09 11:14 ` [PATCH 13/18] drm/i915: Compile out engine debug for release Chris Wilson
2018-04-26 10:15 ` Mika Kuoppala
2018-04-09 11:14 ` [PATCH 14/18] drm/i915/execlists: Force preemption via reset on timeout Chris Wilson
2018-04-09 11:14 ` [PATCH 15/18] drm/i915/execlists: Try preempt-reset from hardirq timer context Chris Wilson
2018-04-09 11:14 ` [PATCH 16/18] drm/i915/preemption: Select timeout when scheduling Chris Wilson
2018-04-09 11:14 ` [PATCH 17/18] drm/i915: Use a preemption timeout to enforce interactivity Chris Wilson
2018-04-09 11:14 ` [PATCH 18/18] drm/i915: Allow user control over preempt timeout on their important context Chris Wilson
2018-04-09 11:29 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [01/18] drm/i915/execlists: Set queue priority from secondary port Patchwork
2018-04-09 11:44 ` ✓ Fi.CI.BAT: success " Patchwork
2018-04-09 13:08 ` ✗ 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=878t9e13eh.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.