Re: atomic cas, again; PHP this time (was Re: Please review this diff for atomic ops in mesa on m68k)
On Sun, Mar 11, 2012 at 17:26, Thorsten Glaser <firstname.lastname@example.org> wrote:
> Geert Uytterhoeven dixit:
>>CAS is a read-modify-write instruction, which is not guaranteed to work
>>on all m68k platforms (hence the existence of CONFIG_RMW_INSNS in
> this issue is popping up again with the php5-fpm SAPI, which wants
> __sync_bool_compare_and_swap (and uses that if available).
> I’m a bit concerned about performance (strace already shows a LOT
> of SYS_333 calls since TLS). On what m68k platforms is cas.l safe
> and is there a sane set of #if to check for it? Or do we really
> have to use the syscall, all the time? (This question being the
> main reason for me to write this mail – after all, I’m not fully
> familiar with m68k specifics, nor with whether or how a MMU Linux
> Coldfire port would deal with things or whether there are plans
> to really do one.)
Yes, you should use the syscall, as finding out whether cas is safe
or not from userspace is non-trivial.
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- email@example.com
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds