You need to sign in or sign up before continuing.
提交 ab306cae 编写于 作者: C Chris Metcalf

arch/tile: use atomic exchange in arch_write_unlock()

This idiom is used elsewhere when we do an unlock by writing a zero,
but I missed it here.  Using an atomic operation avoids waiting
on the write buffer for the unlocking write to be sent to the home cache.
Signed-off-by: NChris Metcalf <cmetcalf@tilera.com>
上级 b14f2190
...@@ -137,7 +137,7 @@ static inline void arch_read_unlock(arch_rwlock_t *rw) ...@@ -137,7 +137,7 @@ static inline void arch_read_unlock(arch_rwlock_t *rw)
static inline void arch_write_unlock(arch_rwlock_t *rw) static inline void arch_write_unlock(arch_rwlock_t *rw)
{ {
__insn_mf(); __insn_mf();
rw->lock = 0; __insn_exch4(&rw->lock, 0); /* Avoid waiting in the write buffer. */
} }
static inline int arch_read_trylock(arch_rwlock_t *rw) static inline int arch_read_trylock(arch_rwlock_t *rw)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册