* Nicolas Pitre <[email protected]> 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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Stuff]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
[Linux Resources]