From: Mika Kuoppala <mika.kuoppala@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v2 1/3] drm/i915: Refactor wakeup of the next breadcrumb waiter
Date: Fri, 03 Mar 2017 18:19:23 +0200 [thread overview]
Message-ID: <87tw7az62c.fsf@gaia.fi.intel.com> (raw)
In-Reply-To: <20170303121710.14497-1-chris@chris-wilson.co.uk>
Chris Wilson <chris@chris-wilson.co.uk> writes:
> Refactor the common task of updating the first_waiter, serialised with
> the interrupt handler. When we update the first_waiter, we also need to
> wakeup the new bottom-half in order to complete the actions that we may
> have delegated to it (such as checking the irq-seqno coherency or waking
> up other lower priority concurrent waiters).
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Mika Kuoppala <mika.kuoppala@intel.com>
> ---
> drivers/gpu/drm/i915/intel_breadcrumbs.c | 48 +++++++++++++-------------------
> 1 file changed, 19 insertions(+), 29 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_breadcrumbs.c b/drivers/gpu/drm/i915/intel_breadcrumbs.c
> index 235d4645a5cf..1cc50304f824 100644
> --- a/drivers/gpu/drm/i915/intel_breadcrumbs.c
> +++ b/drivers/gpu/drm/i915/intel_breadcrumbs.c
> @@ -287,6 +287,21 @@ static inline void __intel_breadcrumbs_finish(struct intel_breadcrumbs *b,
> wake_up_process(wait->tsk); /* implicit smp_wmb() */
> }
>
> +static inline void __intel_breadcrumbs_next(struct intel_engine_cs *engine,
> + struct rb_node *next)
> +{
> + struct intel_breadcrumbs *b = &engine->breadcrumbs;
> +
> + GEM_BUG_ON(!b->irq_armed);
> + b->first_wait = to_wait(next);
> +
> + /* We always wake up the next waiter that takes over as the bottom-half
> + * as we may delegate not only the irq-seqno barrier to the next waiter
> + * but also the task of waking up concurrent waiters.
> + */
> + wake_up_process(to_wait(next)->tsk);
> +}
> +
> static bool __intel_engine_add_wait(struct intel_engine_cs *engine,
> struct intel_wait *wait)
> {
> @@ -357,21 +372,7 @@ static bool __intel_engine_add_wait(struct intel_engine_cs *engine,
> GEM_BUG_ON(!next && !first);
> if (next && next != &wait->node) {
> GEM_BUG_ON(first);
> - b->first_wait = to_wait(next);
> - /* As there is a delay between reading the current
> - * seqno, processing the completed tasks and selecting
> - * the next waiter, we may have missed the interrupt
> - * and so need for the next bottom-half to wakeup.
> - *
> - * Also as we enable the IRQ, we may miss the
> - * interrupt for that seqno, so we have to wake up
> - * the next bottom-half in order to do a coherent check
> - * in case the seqno passed.
> - */
> - __intel_breadcrumbs_enable_irq(b);
> - if (test_bit(ENGINE_IRQ_BREADCRUMB,
> - &engine->irq_posted))
> - wake_up_process(to_wait(next)->tsk);
> + __intel_breadcrumbs_next(engine, next);
> }
>
> do {
> @@ -473,21 +474,10 @@ static void __intel_engine_remove_wait(struct intel_engine_cs *engine,
> }
> }
>
> - if (next) {
> - /* In our haste, we may have completed the first waiter
> - * before we enabled the interrupt. Do so now as we
> - * have a second waiter for a future seqno. Afterwards,
> - * we have to wake up that waiter in case we missed
> - * the interrupt, or if we have to handle an
> - * exception rather than a seqno completion.
> - */
> - b->first_wait = to_wait(next);
> - if (b->first_wait->seqno != wait->seqno)
> - __intel_breadcrumbs_enable_irq(b);
> - wake_up_process(b->first_wait->tsk);
> - } else {
> + if (next)
> + __intel_breadcrumbs_next(engine, next);
> + else
> b->first_wait = NULL;
> - }
> } else {
> GEM_BUG_ON(rb_first(&b->waiters) == &wait->node);
> }
> --
> 2.11.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
prev parent reply other threads:[~2017-03-03 16:21 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-03 12:17 [PATCH v2 1/3] drm/i915: Refactor wakeup of the next breadcrumb waiter Chris Wilson
2017-03-03 12:17 ` [PATCH v2 2/3] drm/i915: Split breadcrumbs spinlock into two Chris Wilson
2017-03-03 17:26 ` Mika Kuoppala
2017-03-03 17:37 ` Chris Wilson
2017-03-03 17:50 ` Mika Kuoppala
2017-03-03 12:17 ` [PATCH v2 3/3] drm/i915: Only wake the waiter from the interrupt if passed Chris Wilson
2017-03-03 17:57 ` Mika Kuoppala
2017-03-03 18:12 ` Chris Wilson
2017-03-03 12:48 ` ✓ Fi.CI.BAT: success for series starting with [v2,1/3] drm/i915: Refactor wakeup of the next breadcrumb waiter Patchwork
2017-03-03 14:07 ` [PATCH v2 1/3] " Chris Wilson
2017-03-03 16:19 ` Mika Kuoppala [this message]
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=87tw7az62c.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.