On Sat, 14 Jul 2001, Ralf Baechle wrote:
> I'm just making an attempt to re-implement the ll/sc emulation as light
> as possible. I hope to get the overhead down to the point were we don't
> need _test_and_set anymore - in any case below the overhead of a syscall.
>
> Have you ever profiled the number of calls to MIPS_ATOMIC_SET or
> _test_and_set? They'll be the other factor in a decission.
I didn't profile it very extensively, yet when stracing `ls /usr/lib'
(fileutils 4.1 linked against glibc 2.2.3) on my system once I yielded
~4500 syscalls of which ~4000 were _test_and_set() (or MIPS_ATOMIC_SET,
depending on my kernel/glibc configuration) invocations. Yes, libpthread
appears to assume atomic operations are cheap, which is justifiable as
they are indeed, for almost every other CPU type.
Also I feel having ll and sc opcodes in a pure MIPS I binary is somewhat
ugly (e.g. `objdump' won't disassemble them unless a MIPS II+ CPU is
specified), but I could probably live with it if performance was not
worse.
--
+ Maciej W. Rozycki, Technical University of Gdansk, Poland +
+--------------------------------------------------------------+
+ e-mail: macro@ds2.pg.gda.pl, PGP key available +
|