Skip to contentSkip to conversation

Add barrier to xnlock_put

PATCH In review Jan Kiszka 2 participants 2 messages Mar 1, 2008 Generic include/asm header files

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

PATCH 1/1 Add barrier to xnlock_put

To avoid that this gets lost in the discussion about my xnlock refactoring, here is a separate patch to fix the SMP behavior of xnlock_put. OK to merge it into trunk and stable trees?

Jan

---
 ChangeLog                    |    4 ++++
 include/asm-generic/system.h |    6 ++++++
 2 files changed, 10 insertions(+)
include/asm-generic/system.h +6 -0
Index: b/include/asm-generic/system.h
===================================================================
@@ -307,6 +307,12 @@ static inline void xnlock_put (xnlock_t 
 		    xnlock_stats[cpu].line = lock->line;
 	    }
 #endif /* XENO_DEBUG(NUCLEUS) */
+	    /*
+	     * Make sure all data written inside the lock is visible to
+	     * other CPUs before we release the lock.
+	     */
+	    xnarch_memory_barrier();
+
 	    atomic_set(&lock->owner, ~0);
     }
 #if XENO_DEBUG(NUCLEUS)
ChangeLog +4 -0
Index: b/ChangeLog
===================================================================
@@ -1,3 +1,7 @@
+2008-03-01  Jan Kiszka  <[email protected]>
+
+	* include/asm-generic/system.h (xnlock_put): Add proper barrier.
+
 2008-02-15  Gilles Chanteperdrix  <[email protected]>
 
 	* src/skins/posix/thread.c (__wrap_pthread_create): Follow more
#1 lore raw
Quoted 3 lines · Jan Kiszka

To avoid that this gets lost in the discussion about my xnlock refactoring, here is a separate patch to fix the SMP behavior of xnlock_put. OK to merge it into trunk and stable trees?

Ok.

Signature · 1 line
					    Gilles Chanteperdrix.