Mirror of the lttng-dev mailing list
 help / color / mirror / Atom feed
From: pbonzini@redhat.com (Paolo Bonzini)
Subject: [ltt-dev] [PATCH tip/core/rcu 1/4] Add header files supporting gcc __sync_ primitives
Date: Thu, 17 Jun 2010 03:55:47 -0400 (EDT)	[thread overview]
Message-ID: <1936029737.362931276761347025.JavaMail.root@zmail07.collab.prod.int.phx2.redhat.com> (raw)
In-Reply-To: <1276750080-9086-1-git-send-email-paulmck@linux.vnet.ibm.com>

+#define CACHE_LINE_SIZE 128
+#define mb()    __sync_synchronize()

These are provided by arch_generic.h, aren't they?

In particular, CACHE_LINE_SIZE should be updated there from 64
to 128 if we deem that value to be better.

diff --git a/urcu/uatomic_arch_gcc.h b/urcu/uatomic_arch_gcc.h
new file mode 100644
index 0000000..df208bd
--- /dev/null
+++ b/urcu/uatomic_arch_gcc.h
@@ -0,0 +1,48 @@
+/* xchg */
+#define uatomic_xchg(addr, v) __sync_lock_test_and_set(addr, v)

__sync_lock_test_and_set may only support v==1, and is only
an acquire barrier, so I think it's better to just use the
definition in uatomic_arch_generic.h.

+/* cmpxchg */
+#define uatomic_cmpxchg(addr, old, _new) \
+	__sync_val_compare_and_swap(addr, old, _new)
+
+/* uatomic_add_return */
+#define uatomic_add_return(addr, v) __sync_add_and_fetch(addr, v)

These are also provided by uatomic_arch_generic.h.

Paolo




  reply	other threads:[~2010-06-17  7:55 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-17  4:47 [ltt-dev] [PATCH 0/4] v2: Add gcc primitives, ia64 support, ARMv7L support, and kill unknown Paul E. McKenney
2010-06-17  4:47 ` [ltt-dev] [PATCH tip/core/rcu 1/4] Add header files supporting gcc __sync_ primitives Paul E. McKenney
2010-06-17  7:55   ` Paolo Bonzini [this message]
2010-06-17 16:45     ` Paul E. McKenney
2010-06-17  4:47 ` [ltt-dev] [PATCH tip/core/rcu 2/4] Add ia64 architecture based on gcc primitives Paul E. McKenney
2010-06-17  4:47 ` [ltt-dev] [PATCH tip/core/rcu 3/4] Add native ARM port for armv7l Paul E. McKenney
2010-06-17  4:48 ` [ltt-dev] [PATCH tip/core/rcu 4/4] Force build failure on unknown architectures Paul E. McKenney
2010-06-18 15:46 ` [ltt-dev] [PATCH 0/4] v2: Add gcc primitives, ia64 support, ARMv7L support, and kill unknown Mathieu Desnoyers
2010-06-18 16:02   ` Mathieu Desnoyers
2010-06-18 16:13     ` Paul E. McKenney
2010-06-18 16:12   ` Paul E. McKenney

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=1936029737.362931276761347025.JavaMail.root@zmail07.collab.prod.int.phx2.redhat.com \
    --to=pbonzini@redhat.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox