[Intel-gfx] [PATCH] drm/i915: Always wakeup the next breadcrumb waiter

Chris Wilson chris at chris-wilson.co.uk
Fri Mar 3 07:49:00 UTC 2017


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 <chris at chris-wilson.co.uk>

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


More information about the Intel-gfx mailing list