]> git.baikalelectronics.ru Git - kernel.git/commit
arch/tile: allow nonatomic stores to interoperate with fast atomic syscalls
authorChris Metcalf <cmetcalf@tilera.com>
Mon, 2 May 2011 19:13:13 +0000 (15:13 -0400)
committerChris Metcalf <cmetcalf@tilera.com>
Wed, 4 May 2011 18:40:07 +0000 (14:40 -0400)
commit0a3a304707357da4aff188953acf454cf54ab2de
treedd05474f47c908f4167cbcd29f5cd41d66e6eb2f
parent2353a45dad30a5ba153d76121223275a6a228925
arch/tile: allow nonatomic stores to interoperate with fast atomic syscalls

This semantic was already true for atomic operations within the kernel,
and this change makes it true for the fast atomic syscalls (__NR_cmpxchg
and __NR_atomic_update) as well.  Previously, user-space had to use
the fast atomic syscalls exclusively to update memory, since raw stores
could lose a race with the atomic update code even when the atomic update
hadn't actually modified the value.

With this change, we no longer write back the value to memory if it
hasn't changed.  This allows certain types of idioms in user space to
work as expected, e.g. "atomic exchange" to acquire a spinlock, followed
by a raw store of zero to release the lock.

Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>
arch/tile/kernel/intvec_32.S
arch/tile/lib/atomic_asm_32.S