Re: [PATCH] WorkStruct: Implement generic UP cmpxchg() where an arch doesn't support it

Christoph Lameter
2006-12-06T21:52:45Z

On Wed, 6 Dec 2006, Matthew Wilcox wrote:

> And for those of us with only load-and-zero, that's simply:
>
> #define load_locked(addr) spin_lock(hash(addr)), *addr
> #define store_exclusive(addr, old, new) \
> *addr = new, spin_unlock(hash(addr)), 0
>
> which is also optimal for us.

This means we tolerate the assignment race for SMP that was pointed out
earlier?

cmpxchg emulation may then also be tolerable just replace the irq
enable/disable in David's implementation with taking a spin lock?