All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@domain.hid>
To: Xenomai-core@domain.hid
Subject: [Xenomai-core] [PATCH] Add barrier to xnlock_put
Date: Sat, 01 Mar 2008 10:48:24 +0100	[thread overview]
Message-ID: <47C92668.9080805@domain.hid> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 194 bytes --]

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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: add-barrier-to-xnlock_put.patch --]
[-- Type: text/x-patch; name="add-barrier-to-xnlock_put.patch", Size: 1111 bytes --]

---
 ChangeLog                    |    4 ++++
 include/asm-generic/system.h |    6 ++++++
 2 files changed, 10 insertions(+)

Index: b/include/asm-generic/system.h
===================================================================
--- a/include/asm-generic/system.h
+++ 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)
Index: b/ChangeLog
===================================================================
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2008-03-01  Jan Kiszka  <jan.kiszka@domain.hid>
+
+	* include/asm-generic/system.h (xnlock_put): Add proper barrier.
+
 2008-02-15  Gilles Chanteperdrix  <gilles.chanteperdrix@xenomai.org>
 
 	* src/skins/posix/thread.c (__wrap_pthread_create): Follow more

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 254 bytes --]

             reply	other threads:[~2008-03-01  9:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-01  9:48 Jan Kiszka [this message]
2008-03-01 12:40 ` [Xenomai-core] [PATCH] Add barrier to xnlock_put Gilles Chanteperdrix

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47C92668.9080805@domain.hid \
    --to=jan.kiszka@domain.hid \
    --cc=Xenomai-core@domain.hid \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.