lkml.org 
[lkml]   [2016]   [Sep]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 3/7] ipc/sem.c: Rely on spin_unlock_wait() = spin_lock();spin_unlock().
Date
From memory ordering point of view, spin_unlock_wait() provides
the same guarantees as spin_lock(); spin_unlock().

Therefore the smp_mb() after spin_lock() is not necessary,
spin_unlock_wait() must provide the memory ordering.

Signed-off-by: Manfred Spraul <manfred@colorfullife.com>
Cc: Will Deacon <will.deacon@arm.com>
---
ipc/sem.c | 8 --------
1 file changed, 8 deletions(-)

diff --git a/ipc/sem.c b/ipc/sem.c
index 6586e0a..a5da82c 100644
--- a/ipc/sem.c
+++ b/ipc/sem.c
@@ -355,14 +355,6 @@ static inline int sem_lock(struct sem_array *sma, struct sembuf *sops,
*/
spin_lock(&sem->lock);

- /*
- * See 51d7d5205d33
- * ("powerpc: Add smp_mb() to arch_spin_is_locked()"):
- * A full barrier is required: the write of sem->lock
- * must be visible before the read is executed
- */
- smp_mb();
-
if (!smp_load_acquire(&sma->complex_mode)) {
/* fast path successful! */
return sops->sem_num;
--
2.7.4
\
 
 \ /
  Last update: 2016-09-17 09:58    [W:0.052 / U:0.556 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site