public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
* Why does ia64 not use fetchadd in atomic.h?
@ 2006-06-15 20:35 Christoph Lameter
  2006-06-15 20:49 ` Matthew Wilcox
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Christoph Lameter @ 2006-06-15 20:35 UTC (permalink / raw)
  To: linux-ia64

I just looked at at the asm generated by some of the use of atomic for 
statistics and saw that there were complicated compxchg constructs where I 
would have expected a simple fetchadd. Why is this?

F.e.

static __inline__ int
ia64_atomic_add (int i, atomic_t *v)
{
        __s32 old, new;
        CMPXCHG_BUGCHECK_DECL

        do {
                CMPXCHG_BUGCHECK(v);
                old = atomic_read(v);
                new = old + i;
        } while (ia64_cmpxchg(acq, v, old, new, sizeof(atomic_t)) != old);
        return new;
}

Why not

#define ia64_atomic_add(__i, __v) ia64_fetchadd(__i, &v->counter, acq)

?



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2006-06-15 21:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-15 20:35 Why does ia64 not use fetchadd in atomic.h? Christoph Lameter
2006-06-15 20:49 ` Matthew Wilcox
2006-06-15 20:50 ` Chen, Kenneth W
2006-06-15 21:28 ` Christoph Lameter
2006-06-15 21:39 ` Chen, Kenneth W
2006-06-15 21:48 ` Christoph Lameter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox