Re: atomic-up.h speedup : compared with irq disable/enable

Sergei Shtylyov <[email protected]>
Newsgroups gmane.linux.kernel.tracing
Organization MontaVista Software Inc.
Message-ID <[email protected]>
Hello.

Mathieu Desnoyers wrote:
> Some more information about the non LOCKed atomic ops that I now use on SMP :

> A test ran on a 3GHz Pentium 4 shows that (20000 loops) :

> irq save/restore pair      210.60 ns
> 
> cmpxchg                     49.46 ns
>     (76 % speedup)
> cmpxchg-up (no lock prefix)  9.00 ns
>     (95 % speedup)

> Does anyone still believe that cli()/sti() is faster ? :)

    Alas, it's not so for RISCs anyway -- they don't have RMW type 
instructions with memory desctinations, so you still have to use cli/sti (or 
locking).
   I guess we also need to benchmark this on some RISCs like ARM/MIPS/PPC...

> Mathieu

WBR, Sergei
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.