From: Daniel Vetter <daniel@ffwll.ch>
To: Zhao Yakui <yakui.zhao@intel.com>
Cc: "intel-gfx@lists.freedesktop.org" <intel-gfx@lists.freedesktop.org>
Subject: Re: [PATCH 5/5] drm/i915:Use the coarse mechanism based on drm fd to dispatch the BSD command on BDW GT3
Date: Thu, 10 Apr 2014 11:03:32 +0200 [thread overview]
Message-ID: <20140410090332.GR9262@phenom.ffwll.local> (raw)
In-Reply-To: <1397117062.2039.152.camel@genxdev-ykzhao.sh.intel.com>
On Thu, Apr 10, 2014 at 04:04:22PM +0800, Zhao Yakui wrote:
> On Thu, 2014-04-10 at 00:48 -0600, Daniel Vetter wrote:
> > On Thu, Apr 10, 2014 at 10:24:53AM +0800, Zhao Yakui wrote:
> > > On Wed, 2014-04-09 at 08:34 -0600, Daniel Vetter wrote:
> > > > On Wed, Apr 09, 2014 at 09:59:56AM +0800, Zhao Yakui wrote:
> > > > > The BDW GT3 has two independent BSD rings, which can be used to process the
> > > > > video commands. To be simpler, it is transparent to user-space driver/middleware.
> > > > > Instead the kernel driver will decide which ring is to dispatch the BSD video
> > > > > command.
> > > > >
> > > > > As every BSD ring is powerful, it is enough to dispatch the BSD video command
> > > > > based on the drm fd. In such case the different BSD ring is used for video playing
> > > > > back and encoding. At the same time the coarse dispatch mechanism can help to avoid
> > > > > the object synchronization between the BSD rings.
> > > > >
> > > > > Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
> > > >
> > > > This looks way too complicated. First things first please get rid of the
> > > > atomic_t usage. If you don't have _massive_ comments explaining the memory
> > > > barriers you're most likely using linux kernel atomic_t wrong. They are
> > > > fully unordered.
> > >
> > > Thanks for the review.
> > >
> > > For the atomic_t usage: I will remove it in next version as the counter
> > > is already protected by the lock.
> > >
> > > >
> > > > With that out of the way this still looks a bit complicated really. Can't
> > > > we just use a very simple static rule in gen8_dispatch_bsd_ring which
> > > > hashed the pointer address of the file_priv? Just to get things going,
> > > > once we have a clear need we can try to make things more intelligent. But
> > > > in case of doubt I really prefer if we start with the dumbest possible
> > > > approach first and add complexity instead of starting with something
> > > > really complex and simplifying it.
> > >
> > > Do you mean that file_priv is hashed and then is mapped to BSD 0 or 1
> > > ring?
> >
> > Yeah, that's the idea. Get in the basic support first, make it fancy like
> > you describe below second. This has a few upsides:
> > - We can concentrate on validating basic support in the first round
> > instead of potentially fighting a bug in the load balancer.
> > - Discussions and performance testing for the load balancer won't hold up
> > the entire feature.
> > - Like I've said this might not be required. Before we add more complexity
> > than just hashing the file_priv I want to see some benchmarks of
> > expected workloads that show that the load balancing is indeed a good
> > idea - for the case of a transcode server I guess we should have
> > sufficient in-flight operations that it won't really matter. Or at least
> > I hope so.
> >
>
> OK. Understand your concerns. I can split it two steps. One is to add
> the basic support. The second step is for the optimization.
>
> But I don't think that the hash of file_priv is a good idea. As it only
> has two rings, it is possible that the hash value is always mapped to
> BSD ring 0. In such case when multiples video clips are played back,
> the performance can't meet with the requirement.(For example: User can
> play back 4 1080p video clips concurrently when only one BSD ring is
> used. On the BDW GT3, they hope to play back 8 1080p video clips
> concurrently. The poor hash design will cause that all the workload are
> mapped to one BSD ring and then it can't meet with the requirement).
>
> How about using the ping-pong mechanism for the file_priv? For one new
> fd, it will use BSD ring 0 and then next file_priv will use BSD ring 1.
> Then BSD ring 0....BSD ring 1.
>
> Does this make sense to you?
Well the point of the hash is that it's dumb and simple, but maybe too
dumb. If we wend up with 3 streams on one vcs and 1 on the other, then we
have a good reason to merge the 2nd patch ;-)
Really, the point of the first patch is just so that we have /something/
which uses both rings with a reasonable chance, so that we can get testing
and validation off the ground. E.g. in the test I'd use 10 or so drm fds to
make sure that at least one of them uses the other ring, in case the hash
function isn't great.
-Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
next prev parent reply other threads:[~2014-04-10 9:03 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-09 1:59 [PATCH 0/5] drm/i915: Add the support of dual BSD rings on BDW GT3 Zhao Yakui
2014-04-09 1:59 ` [PATCH 1/5] drm/i915: Split the BDW device definition to prepare for " Zhao Yakui
2014-04-09 14:27 ` Daniel Vetter
2014-04-10 0:44 ` Zhao Yakui
2014-04-09 1:59 ` [PATCH 2/5] drm/i915:Initialize the second BSD ring on BDW GT3 machine Zhao Yakui
2014-04-09 1:59 ` [PATCH 3/5] drm/i915:Handle the irq interrupt for the second BSD ring Zhao Yakui
2014-04-09 1:59 ` [PATCH 4/5] drm/i915:Add the VCS2 switch in Intel_ring_setup_status_page for Gen7 to remove the switch check warning Zhao Yakui
2014-04-09 14:29 ` Daniel Vetter
2014-04-10 0:45 ` Zhao Yakui
2014-04-09 1:59 ` [PATCH 5/5] drm/i915:Use the coarse mechanism based on drm fd to dispatch the BSD command on BDW GT3 Zhao Yakui
2014-04-09 14:34 ` Daniel Vetter
2014-04-10 2:24 ` Zhao Yakui
2014-04-10 6:48 ` Daniel Vetter
2014-04-10 8:04 ` Zhao Yakui
2014-04-10 9:03 ` Daniel Vetter [this message]
2014-04-11 0:53 ` Zhao Yakui
2014-04-09 14:45 ` [PATCH 0/5] drm/i915: Add the support of dual BSD rings " Daniel Vetter
2014-04-10 3:28 ` Zhao Yakui
2014-04-10 6:58 ` Daniel Vetter
2014-04-10 8:28 ` Zhao Yakui
2014-04-10 9:04 ` Daniel Vetter
2014-04-11 0:56 ` Zhao Yakui
2014-04-11 8:57 ` Daniel Vetter
2014-04-14 1:05 ` Zhao Yakui
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=20140410090332.GR9262@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=intel-gfx@lists.freedesktop.org \
--cc=yakui.zhao@intel.com \
/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