Re: [patch 0/9] mutex subsystem, -V4

From: Ingo Molnar
Date: Thu Dec 22 2005 - 16:54:17 EST



* Nicolas Pitre <nico@xxxxxxx> wrote:

> I'd like to point out that, while atomic_dec_call_if_* is really nice
> on i386, it is probably only good for i386 since no other architecture
> will be able to provide a better implementation than what can be done
> with atomic_dec_return() anyway. Yet that IMHO overloaded
> atomic_dec_call_if_* stuff appears in core code.

i'd have no problem with going to atomic_dec_return() on i386 too.
atomic_dec_call_if_*() is just working around a gcc limitation: there's
no way to pass a condition from inline assembly into C code, it has to
go over a register. But the difference is small, just 1 extra 'sete'
instruction. So x86 would be just fine with atomic_dec_return() too.

anyway, it seems like everyone would like to hack a few instructions
from the fastpath, so we might as well go with your approach. As long as
the state is well-defined (and it has to be well-defined because it all
hits the common slowpath), and the function names are descriptive of
what happens, it's fine with me.

Ingo
-
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/