On Thu, Mar 02, 2017 at 11:02:11PM +0000, Chris Wilson wrote:
> Whenever we advance from one completed waiter to the next, give it a
> kick so that it can check to see if its seqno completed during the
> switch. We used to rely on faking an interrupt to determine when the
> wake up was required, but now the irq should always be enabled and so no
> longer receive the kick when starting a new waiter.
> 
> Signed-off-by: Chris Wilson <[email protected]>

I can't decide if there's a bug here or not. When we install a new
waiter, we wakeup any that are complete, but the question is do we need
to wakeup the next.

Thread:                                 IRQ:
spin_lock_irq:
        consume expired
        first_waiter = next
        if (irq)
                wake_up(next);
                                        irq = true
                                        spin_lock:
                                                wake_up(first_waiter);

Will be fine.

                                        irq = true
                                        spin_lock:
                                                wake_up(first_waiter);
spin_lock_irq:
        consume expired
        first_waiter = next
        if (irq)
                wake_up(next);

Either the thread consumes the irq to perform the barrier before
completing, or it leaves it set and the next waiter is woken. Either
way, because the wake_up in the IRQ is now serliased by the spin_lock we
should never loose a wakeup.

In the failure case in CI, irq = false, implying that the wakeup had
been consumed before it slept. I think I need to look elsewhere for the
missing wakeup - or it is a legimate missed breadcrumb on that machine,
which looks unlikely as the error appears very specific and an ordinary
miss is likely to show up in many different tests.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reply via email to