From: Daniel Vetter <daniel@ffwll.ch>
To: Chris Wilson <chris@chris-wilson.co.uk>,
John.C.Harrison@Intel.com, Intel-GFX@Lists.FreeDesktop.Org
Subject: Re: [RFC 3/4] drm/i915: Interrupt driven fences
Date: Mon, 23 Mar 2015 10:22:53 +0100 [thread overview]
Message-ID: <20150323092253.GN1349@phenom.ffwll.local> (raw)
In-Reply-To: <20150320211135.GB16648@nuc-i3427.alporthouse.com>
On Fri, Mar 20, 2015 at 09:11:35PM +0000, Chris Wilson wrote:
> On Fri, Mar 20, 2015 at 05:48:36PM +0000, John.C.Harrison@Intel.com wrote:
> > From: John Harrison <John.C.Harrison@Intel.com>
> >
> > The intended usage model for struct fence is that the signalled status should be
> > set on demand rather than polled. That is, there should not be a need for a
> > 'signaled' function to be called everytime the status is queried. Instead,
> > 'something' should be done to enable a signal callback from the hardware which
> > will update the state directly. In the case of requests, this is the seqno
> > update interrupt. The idea is that this callback will only be enabled on demand
> > when something actually tries to wait on the fence.
> >
> > This change removes the polling test and replaces it with the callback scheme.
> > To avoid race conditions where signals can be sent before anyone is waiting for
> > them, it does not implement the callback on demand feature. When the GPU
> > scheduler arrives, it will need to know about the completion of every single
> > request anyway. So it is far simpler to not put in complex and messy anti-race
> > code in the first place given that it will not be needed in the future.
> >
> > Instead, each fence is added to a 'please poke me' list at the start of
> > i915_add_request(). This happens before the commands to generate the seqno
> > interrupt are added to the ring thus is guaranteed to be race free. The
> > interrupt handler then scans through the 'poke me' list when a new seqno pops
> > out and signals any matching fence/request. The fence is then removed from the
> > list so the entire request stack does not need to be scanned every time.
>
> No. Please let's not go back to the bad old days of generating an interrupt
> per batch, and doing a lot more work inside the interrupt handler.
Yeah, enable_signalling should be the place where we grab the interrupt
reference. Also that we shouldn't call this unconditionally, that pretty
much defeats the point of that fastpath optimization.
Another complication is missed interrupts. If we detect those and someone
calls enable_signalling then we need to fire up a timer to wake up once
per jiffy and save stuck fences. To avoid duplication with the threaded
wait code we could remove the fallback wakeups from there and just rely on
that timer everywhere.
-Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2015-03-23 9:21 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-20 17:48 [RFC 0/4] Convert requests to use struct fence John.C.Harrison
2015-03-20 17:48 ` [RFC 1/4] drm/i915: " John.C.Harrison
2015-04-07 9:18 ` [RFC, " Maarten Lankhorst
2015-04-07 10:59 ` John Harrison
2015-04-07 11:18 ` Maarten Lankhorst
2015-04-17 19:22 ` Dave Gordon
2015-04-20 5:13 ` Maarten Lankhorst
2015-03-20 17:48 ` [RFC 2/4] drm/i915: Removed now redudant parameter to i915_gem_request_completed() John.C.Harrison
2015-04-17 18:57 ` Dave Gordon
2015-03-20 17:48 ` [RFC 3/4] drm/i915: Interrupt driven fences John.C.Harrison
2015-03-20 21:11 ` Chris Wilson
2015-03-23 9:22 ` Daniel Vetter [this message]
2015-03-23 12:13 ` John Harrison
2015-03-26 13:22 ` Daniel Vetter
2015-03-26 17:27 ` Jesse Barnes
2015-03-27 8:24 ` Daniel Vetter
2015-03-20 17:48 ` [RFC 4/4] drm/i915: Updated request structure tracing John.C.Harrison
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=20150323092253.GN1349@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=Intel-GFX@Lists.FreeDesktop.Org \
--cc=John.C.Harrison@Intel.com \
--cc=chris@chris-wilson.co.uk \
/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