Re: [PATCH 1/19] MUTEX: Introduce simple mutex implementation

From: Andrew Morton
Date: Thu Dec 15 2005 - 15:18:28 EST


Andrew Morton <akpm@xxxxxxxx> wrote:
>
> David Howells <dhowells@xxxxxxxxxx> wrote:
> >
> > So... Would you then object to an implementation of a mutex appearing in the
> > tree which semaphores that are being used as strict mutexes can be migrated
> > over to as the opportunity arises?
>
> That would be sane.
>

But not very.

Look at it from the POV of major architectures: there's no way the new
mutex code will be faster than down() and up(), so we're adding a bunch of
new tricky locking code which bloats the kernel and has to be understood
and debugged for no gain.

And I don't buy the debuggability argument really. It'd be pretty simple
to add debug code to the existing semaphore code to trap non-mutex usages.
Then go through the few valid non-mutex users and do:

#if debug
sem->this_is_not_a_mutex = 1;
#endif
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/