|| ||Alan Cox <alan-AT-lxorguk.ukuu.org.uk>|
|| ||David Howells <dhowells-AT-redhat.com>|
|| ||Re: [PATCH 1/19] MUTEX: Introduce simple mutex implementation|
|| ||Tue, 13 Dec 2005 13:05:18 +0000|
|| ||torvalds-AT-osdl.org, akpm-AT-osdl.org, hch-AT-infradead.org,
arjan-AT-infradead.org, matthew-AT-wil.cx, linux-kernel-AT-vger.kernel.org,
On Llu, 2005-12-12 at 23:45 +0000, David Howells wrote:
> (5) Redirects the following to apply to the new mutexes rather than the
> traditional semaphores:
And you've audited every occurence ?
> On the basis that most usages of semaphores are as mutexes, this makes
> sense for in most cases it's just then a matter of changing the type from
> struct semaphore to struct mutex.
You propose to rename the existing up and down, which are counting
semaphores, documented and used that way everywhere with mutexes which
are not. Worse still up/down are, second to P/V, the usual forms of
referring to _counting_ semaphores.
It seems to me it would be far far saner to define something like
given the new mutex interface is actually a sleeping interface with the
semantics of the spin_lock interface. Its then obvious what it does, you
don't randomly break other drivers you've not reviewed and the interface
is intuitive rather than obfuscated.
It won't take long for people to then change the name of the performance
critical cases and the others will catch up in time.
It also saves breaking every piece of out of tree kernel code for now
to post comments)