From: Eric Anholt Subject: Re: [PATCH] [RFC] drm/i915: read-read semaphore optimization Date: Tue, 17 Jan 2012 09:55:34 -0800 Message-ID: <8762ga8b8p.fsf@eliezer.anholt.net> References: <1323748328-10153-1-git-send-email-ben@bwidawsk.net> <87fwgoidza.fsf@eliezer.anholt.net> <4EE79B1F.2000707@bwidawsk.net> <20120116215052.GO3627@phenom.ffwll.local> <4F14A2C7.7020006@bwidawsk.net> <20120117101531.GB4093@phenom.ffwll.local> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1656073308==" Return-path: In-Reply-To: <20120117101531.GB4093@phenom.ffwll.local> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: Daniel Vetter , Ben Widawsky Cc: Daniel Vetter , intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org --===============1656073308== Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" --=-=-= Content-Transfer-Encoding: quoted-printable On Tue, 17 Jan 2012 11:15:31 +0100, Daniel Vetter wrote: > On Mon, Jan 16, 2012 at 02:20:55PM -0800, Ben Widawsky wrote: > > On 01/16/2012 01:50 PM, Daniel Vetter wrote: > > > On Tue, Dec 13, 2011 at 10:36:15AM -0800, Ben Widawsky wrote: > > >> On 12/13/2011 09:22 AM, Eric Anholt wrote: > > >>> On Mon, 12 Dec 2011 19:52:08 -0800, Ben Widawsky = wrote: > > >>>> Since we don't differentiate on the different GPU read domains, it > > >>>> should be safe to allow back to back reads to occur without issuin= g a > > >>>> wait (or flush in the non-semaphore case). > > >>>> > > >>>> This has the unfortunate side effect that we need to keep track of= all > > >>>> the outstanding buffer reads so that we can synchronize on a write= , to > > >>>> another ring (since we don't know which read finishes first). In o= ther > > >>>> words, the code is quite simple for two rings, but gets more trick= y for > > >>>>> 2 rings. > > >>>> > > >>>> Here is a picture of the solution to the above problem > > >>>> > > >>>> Ring 0 Ring 1 Ring 2 > > >>>> batch 0 batch 1 batch 2 > > >>>> read buffer A read buffer A wait batch 0 > > >>>> wait batch 1 > > >>>> write buffer A > > >>>> > > >>>> This code is really untested. I'm hoping for some feedback if this= is > > >>>> worth cleaning up, and testing more thoroughly. > > >>> > > >>> You say it's an optimization -- do you have performance numbers? > > >> > > >> 33% improvement on a hacked version of gem_ring_sync_loop with. > > >> > > >> It's not really a valid test as it's not coherent, but this is > > >> approximately the best case improvement. > > >> > > >> Oddly semaphores doesn't make much difference in this test, which > > >> was surprising. > > >=20 > > > Our domain tracking is already complicated in unfunny ways. And (at l= east > > > without a use-case showing gains with hard numbers in either perf or = power > > > usage) I think this patch is the kind of "this looks cool" stuff that > > > added a lot to the current problem. > > >=20 > > > So before adding more complexity on top I'd like to remove some of the > > > superflous stuff we already have. I.e. all the flushing_list stuff and > > > maybe other things ... > >=20 > > Can you be more clear on what exactly you want done before taking a > > patch like this? Maybe I can work on it during some down time. >=20 > I was thinking about Eric's no-more-domains stuff specifically, which has > tons of natural split-points - and we want to exploit these for merging. > Imo step 1 would be to just rework the batch dispatch in > intel_ringbuffer.c so that we unconditionally invalidate before and flush > afterwards. The ring->flush would become a no-op. No changes to the core > flushing_list tracking for step 1. >=20 > If we can get this in for 3.4 we could (in the -next merge cycle) walk all > the callchains from their ends and rip out everything which is a no-op, > starting from ring->flush. I think that's the safest way to attack this. > Eric? I was stuck with a mysterious regression in my previous attempt at the patch series. I've recently realized that I can do the major code deletion with fewer + lines in the diff, which I hope will avoid that. I'm working it that again now. --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iEYEARECAAYFAk8VthYACgkQHUdvYGzw6vedBACeMn3JP6mZLXvjeoMkENQ/U90Q ej8An3GDQaVw0CqM36QAdiZKCMOnvls0 =H/W5 -----END PGP SIGNATURE----- --=-=-=-- --===============1656073308== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx --===============1656073308==--