From: Peter Zijlstra <a.p.zijlstra@chello.nl>
To: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Cc: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org,
daniel.vetter@ffwll.ch, x86@kernel.org,
dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org,
robclark@gmail.com, tglx@linutronix.de, mingo@elte.hu,
linux-media@vger.kernel.org, Steven Rostedt <rostedt@goodmis.org>
Subject: Re: [PATCH v2 2/3] mutex: add support for reservation style locks, v2
Date: Tue, 02 Apr 2013 13:04:47 +0200 [thread overview]
Message-ID: <1364900687.18374.28.camel@laptop> (raw)
In-Reply-To: <20130228102502.15191.14146.stgit@patser>
On Thu, 2013-02-28 at 11:25 +0100, Maarten Lankhorst wrote:
> +The algorithm that TTM came up with for dealing with this problem is
> +quite simple. For each group of buffers (execbuf) that need to be
> +locked, the caller would be assigned a unique reservation_id, from a
> +global counter. In case of deadlock while locking all the buffers
> +associated with a execbuf, the one with the lowest reservation_id
> +wins, and the one with the higher reservation_id unlocks all of the
> +buffers that it has already locked, and then tries again.
So the thing that made me cringe inside when I read this was making it
all work on -rt, where we also need to take PI into account and ensure
the entire thing is deterministic.
It _might_ be 'easy' and we could fall back to PI mutex behaviour in
the case the reservation IDs match; however the entire for-all-bufs
retry loops do worry me still.
Head hurts, needs more time to ponder. It would be good if someone else
(this would probably be you maarten) would also consider this and
explore
this 'interesting' problem space :-)
next prev parent reply other threads:[~2013-04-02 11:04 UTC|newest]
Thread overview: 57+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-28 10:24 [PATCH v2 1/3] arch: make __mutex_fastpath_lock_retval return whether fastpath succeeded or not Maarten Lankhorst
2013-02-28 10:24 ` Maarten Lankhorst
2013-02-28 10:25 ` [PATCH v2 2/3] mutex: add support for reservation style locks, v2 Maarten Lankhorst
2013-02-28 10:25 ` Maarten Lankhorst
2013-04-02 10:56 ` Peter Zijlstra
2013-04-02 10:56 ` Peter Zijlstra
2013-04-02 10:57 ` Peter Zijlstra
2013-04-02 11:00 ` Peter Zijlstra
2013-04-02 14:57 ` Maarten Lankhorst
2013-04-02 14:57 ` Maarten Lankhorst
2013-04-02 16:59 ` Peter Zijlstra
2013-04-02 17:23 ` Daniel Vetter
2013-04-02 17:23 ` Daniel Vetter
2013-04-02 17:30 ` Daniel Vetter
2013-04-02 17:30 ` Daniel Vetter
2013-04-04 12:01 ` Peter Zijlstra
2013-04-04 12:01 ` Peter Zijlstra
2013-04-04 13:31 ` Daniel Vetter
2013-04-04 16:33 ` Peter Zijlstra
2013-04-04 16:33 ` Peter Zijlstra
2013-04-04 16:38 ` Peter Zijlstra
2013-04-04 16:38 ` Peter Zijlstra
2013-04-04 16:59 ` Daniel Vetter
2013-04-09 22:27 ` Steven Rostedt
2013-04-10 8:27 ` Daniel Vetter
2013-04-10 8:27 ` Daniel Vetter
2013-04-04 16:39 ` Peter Zijlstra
2013-04-04 16:39 ` Peter Zijlstra
2013-04-04 16:41 ` Peter Zijlstra
2013-04-04 16:41 ` Peter Zijlstra
2013-04-09 22:28 ` Steven Rostedt
2013-04-10 9:33 ` Daniel Vetter
2013-04-17 19:08 ` Daniel Vetter
2013-04-18 17:37 ` Ville Syrjälä
2013-04-04 16:43 ` Peter Zijlstra
2013-04-04 16:43 ` Peter Zijlstra
2013-04-04 16:46 ` Peter Zijlstra
2013-04-04 16:46 ` Peter Zijlstra
2013-04-04 16:49 ` Peter Zijlstra
2013-04-04 16:49 ` Peter Zijlstra
2013-04-04 20:44 ` Daniel Vetter
2013-04-04 16:54 ` Peter Zijlstra
2013-04-04 16:54 ` Peter Zijlstra
2013-04-04 16:56 ` Daniel Vetter
2013-04-04 16:56 ` Daniel Vetter
2013-04-08 10:39 ` Peter Zijlstra
2013-04-08 11:50 ` Daniel Vetter
2013-04-08 11:50 ` Daniel Vetter
2013-04-10 10:34 ` Daniel Vetter
2013-04-09 22:42 ` Steven Rostedt
2013-04-10 7:34 ` Peter Zijlstra
2013-04-09 22:18 ` Steven Rostedt
2013-04-02 15:56 ` Daniel Vetter
2013-04-02 11:04 ` Peter Zijlstra [this message]
2013-04-02 11:04 ` Peter Zijlstra
2013-02-28 10:25 ` [PATCH v2 3/3] reservation: Add tests to lib/locking-selftest.c. v2 Maarten Lankhorst
2013-03-09 12:06 ` [Linaro-mm-sig] [PATCH v2 1/3] arch: make __mutex_fastpath_lock_retval return whether fastpath succeeded or not Francesco Lavra
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=1364900687.18374.28.camel@laptop \
--to=a.p.zijlstra@chello.nl \
--cc=daniel.vetter@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=linaro-mm-sig@lists.linaro.org \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=maarten.lankhorst@canonical.com \
--cc=mingo@elte.hu \
--cc=robclark@gmail.com \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).