Thread (31 messages) 31 messages, 7 authors, 2011-03-30

Re: [PATCH 2/2] mutex: Apply adaptive spinning on mutex_trylock()

From: Andrey Kuzmin <hidden>
Date: 2011-03-25 13:50:38
Also in: lkml

On Fri, Mar 25, 2011 at 4:12 PM, Steven Rostedt [off-list ref] wrote:
On Fri, 2011-03-25 at 14:13 +0300, Andrey Kuzmin wrote:
quoted
Turning try_lock into indefinitely spinning one breaks its semantics,
so deadlock is to be expected. But what's wrong in this scenario if
try_lock spins a bit before giving up?
Because that will cause this scenario to spin that "little longer"
always, and introduce latencies that did not exist before. Either the
solution does not break this scenario, or it should not go in.
Broken semantics and extra latency are two separate issues. If the
former is fixed, the latter is easily handled by introducing new
mutex_trylock_spin call that lets one either stick to existing
behavior (try/fail) or choose a new one where latency penalty is
justified by locking patterns.

Regards,
Andrey
-- Steve

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help