From: Inki Dae <inki.dae@samsung.com>
To: 'Daniel Vetter' <daniel@ffwll.ch>
Cc: 'Rob Clark' <robdclark@gmail.com>,
'Maarten Lankhorst' <maarten.lankhorst@canonical.com>,
'linux-fbdev' <linux-fbdev@vger.kernel.org>,
'YoungJun Cho' <yj44.cho@samsung.com>,
'Kyungmin Park' <kyungmin.park@samsung.com>,
"'myungjoo.ham'" <myungjoo.ham@samsung.com>,
'DRI mailing list' <dri-devel@lists.freedesktop.org>,
linux-arm-kernel@lists.infradead.org,
linux-media@vger.kernel.org
Subject: RE: Introduce a new helper framework for buffer synchronization
Date: Wed, 29 May 2013 11:21:37 +0900 [thread overview]
Message-ID: <003c01ce5c13$3f2e8370$bd8b8a50$%dae@samsung.com> (raw)
In-Reply-To: <CAKMK7uHf0G4-3YU6mouUTf4n50Q+viNAA13BzSLDWjPNWLwJVQ@mail.gmail.com>
> -----Original Message-----
> From: daniel.vetter@ffwll.ch [mailto:daniel.vetter@ffwll.ch] On Behalf Of
> Daniel Vetter
> Sent: Wednesday, May 29, 2013 1:50 AM
> To: Inki Dae
> Cc: Rob Clark; Maarten Lankhorst; linux-fbdev; YoungJun Cho; Kyungmin
Park;
> myungjoo.ham; DRI mailing list; linux-arm-kernel@lists.infradead.org;
> linux-media@vger.kernel.org
> Subject: Re: Introduce a new helper framework for buffer synchronization
>
> On Tue, May 28, 2013 at 4:50 PM, Inki Dae <inki.dae@samsung.com> wrote:
> > I think I already used reservation stuff any time in that way except
> > ww-mutex. And I'm not sure that embedded system really needs ww-mutex.
> If
> > there is any case,
> > could you tell me the case? I really need more advice and
> understanding :)
>
> If you have only one driver, you can get away without ww_mutex.
> drm/i915 does it, all buffer state is protected by dev->struct_mutex.
> But as soon as you have multiple drivers sharing buffers with dma_buf
> things will blow up.
>
> Yep, current prime is broken and can lead to deadlocks.
>
> In practice it doesn't (yet) matter since only the X server does the
> sharing dance, and that one's single-threaded. Now you can claim that
> since you have all buffers pinned in embedded gfx anyway, you don't
> care. But both in desktop gfx and embedded gfx the real fun starts
> once you put fences into the mix and link them up with buffers, then
> every command submission risks that deadlock. Furthermore you can get
> unlucky and construct a circle of fences waiting on each another (only
> though if the fence singalling fires off the next batchbuffer
> asynchronously).
In our case, we haven't ever experienced deadlock yet but there is still
possible to face with deadlock in case that a process is sharing two buffer
with another process like below,
Process A committed buffer A and waits for buffer B,
Process B committed buffer B and waits for buffer A
That is deadlock and it seems that you say we can resolve deadlock issue
with ww-mutexes. And it seems that we can replace our block-wakeup mechanism
with mutex lock for more performance.
>
> To prevent such deadlocks you _absolutely_ need to lock _all_ buffers
> that take part in a command submission at once. To do that you either
> need a global lock (ugh) or ww_mutexes.
>
> So ww_mutexes are the fundamental ingredient of all this, if you don't
> see why you need them then everything piled on top is broken. I think
> until you've understood why exactly we need ww_mutexes there's not
> much point in discussing the finer issues of fences, reservation
> objects and how to integrate it with dma_bufs exactly.
>
> I'll try to clarify the motivating example in the ww_mutex
> documentation a bit, but I dunno how else I could explain this ...
>
I don't really want for you waste your time on me. I will trying to apply
ww-mutexes (v4) to the proposed framework for more understanding.
Thanks for your advices.:)
Inki Dae
> Yours, Daniel
> --
> Daniel Vetter
> Software Engineer, Intel Corporation
> +41 (0) 79 365 57 48 - http://blog.ffwll.ch
next prev parent reply other threads:[~2013-05-29 2:21 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-09 7:33 Introduce a new helper framework for buffer synchronization Inki Dae
2013-05-13 8:00 ` Maarten Lankhorst
2013-05-13 9:21 ` Inki Dae
2013-05-13 9:52 ` Maarten Lankhorst
2013-05-13 11:24 ` Inki Dae
2013-05-13 11:40 ` Maarten Lankhorst
2013-05-13 12:21 ` Inki Dae
2013-05-13 13:48 ` Rob Clark
2013-05-13 17:18 ` Inki Dae
2013-05-13 17:58 ` Rob Clark
2013-05-14 2:52 ` Inki Dae
2013-05-14 13:38 ` Rob Clark
2013-05-15 5:19 ` Inki Dae
2013-05-15 14:06 ` Rob Clark
2013-05-17 4:19 ` Daniel Vetter
2013-05-18 7:43 ` Inki Dae
2013-05-18 6:47 ` Inki Dae
2013-05-20 21:13 ` Daniel Vetter
2013-05-20 21:30 ` Daniel Vetter
2013-05-21 7:03 ` Inki Dae
2013-05-21 7:44 ` Daniel Vetter
2013-05-21 9:22 ` Inki Dae
2013-05-23 11:55 ` Daniel Vetter
2013-05-23 13:37 ` Inki Dae
2013-05-27 10:38 ` Inki Dae
2013-05-27 15:23 ` Maarten Lankhorst
2013-05-28 2:49 ` Inki Dae
2013-05-28 7:23 ` Maarten Lankhorst
2013-05-27 15:47 ` Rob Clark
2013-05-27 16:02 ` Daniel Vetter
2013-05-28 4:04 ` Inki Dae
2013-05-28 3:56 ` Inki Dae
2013-05-28 10:32 ` Daniel Vetter
2013-05-28 14:43 ` Inki Dae
2013-05-28 13:48 ` Rob Clark
2013-05-28 14:50 ` Inki Dae
2013-05-28 16:49 ` Daniel Vetter
2013-05-29 2:21 ` Inki Dae [this message]
2013-06-07 9:02 ` Introduce a dmabuf sync " Inki Dae
2013-05-13 19:29 ` Introduce a new helper " Tomasz Figa
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='003c01ce5c13$3f2e8370$bd8b8a50$%dae@samsung.com' \
--to=inki.dae@samsung.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=kyungmin.park@samsung.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=maarten.lankhorst@canonical.com \
--cc=myungjoo.ham@samsung.com \
--cc=robdclark@gmail.com \
--cc=yj44.cho@samsung.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