Thread (86 messages) 86 messages, 20 authors, 2011-01-28

Locking in the clk API

From: Russell King - ARM Linux <hidden>
Date: 2011-01-15 16:22:01
Also in: linux-sh, lkml

On Sat, Jan 15, 2011 at 05:03:29PM +0100, Uwe Kleine-K?nig wrote:
On Sat, Jan 15, 2011 at 03:15:07PM +0000, Russell King - ARM Linux wrote:
quoted
No - I've been suggesting for about a week now about doing two entirely
separate consolidations.
I didn't read that out of your mails.
It was actually four days ago:
| Maybe another approach for the time being is to unify in two steps: first
| unify the implementations which use a spinlock - and those which can use
| a spinlock, and separately those which must use a mutex.
| 
| Then this issue can be revisited in the future.
quoted
I think it would be insane to do the consolidation of the two different
implementations in one patch or even one patch set.  There needs to be
a consolidation of spinlock-based clks as one patch set, which is
entirely separate and independent from the consolidation of mutex-based
clks.
I think they should share most of the code.  Apart from calling
different locking functions they should be pretty much identical, no?
That way you get unions of mutexes and spinlocks (which is one thing
we're trying to avoid) and conditionals controlling whether a mutex
or spinlock is taken - which we've already ascertained was strongly
objected to by folk in mainline (and quite rightfully so IMHO.)
quoted
What if one of the consolidations turns out to be a problem?  Do we want
to throw both out, or do we want to keep as much as we possibly can?
Do you really expect fundamental problems that make it necessary to
switch all platforms that use the (say) sleeping variant back to their
original implementation?  I don't think that when the general idea of
using clk_ops prooves for the atomic case it cannot happen that a
"native" implementation for a sleeping clk is better that a sleeping
clk_ops implementation.
I'm saying keep all the options open until we've got the whole thing
sorted out.  If you think it's possible to do without creating a mess
in the process - and without unions of mutexes and spinlocks or
conditionals controlling whether we use mutex_lock vs spin_lock then
please show the patches.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help