From: pbonzini@redhat.com (Paolo Bonzini)
Subject: [ltt-dev] [PATCH 07/11] add uatomic_gcc.h, use it for default definitions
Date: Mon, 15 Feb 2010 09:05:32 +0100 [thread overview]
Message-ID: <4B79004C.7090407@redhat.com> (raw)
In-Reply-To: <20100214144525.GH5871@Krystal>
On 02/14/2010 03:45 PM, Mathieu Desnoyers wrote:
>> > - if cmpxchg is present, use it to implement xchg and add_return;
>
> Not sure I understand this comment, and not sure it matches the patch.
> x86 has xchg() which is faster than a cmpxchg-based fallback, and you
> seem to leave the code as-is. Can you elaborate ?
Each per-architecture file can provide its own xchg and add_return which
are then used instead of the defaults. For example, x86 uses entirely
custom code, and PPC uses its own implementation of xchg (since it is
also much faster than cmpxchg on ll/sc machines).
Basically, in this case uatomic_gcc.h is using the approach of
uatomic_arch_sparc64.h.
>> > - if it is not present, implement all three using __sync_* builtins
>
> Starting from which gcc versions does these __sync_* builtins work ?
> (question applies for the builtin memory barrier too).
The builtins appeared in 4.2, but they were backported to 4.1 by some
vendors.
Note that on SPARC64 and S390 they were already needed to build the
library because the tests used them.urcu-bp-static.h. However the
clients of liburcu did not need the compiler to have __sync builtins.
After this patch, a new compiler is necessary on S390 and PPC to use the
following files:
urcu-bp-static.h:#include <urcu/uatomic_arch.h>
urcu-defer-static.h:#include <urcu/uatomic_arch.h>
urcu-pointer-static.h:#include <urcu/uatomic_arch.h>
urcu-pointer.h:#include <urcu/uatomic_arch.h>
urcu-qsbr-static.h:#include <urcu/uatomic_arch.h>
urcu-static.h:#include <urcu/uatomic_arch.h>
I'll test a patch to remove the inclusion from urcu-pointer.h since it
seems unnecessary to me.
After this, a client that is interested in using an older GCC can thus
use _LGPL_SOURCE if it finds a compiler that is not new enough. I can
also make this automatic if you prefer.
Paolo
next prev parent reply other threads:[~2010-02-15 8:05 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-13 17:16 [ltt-dev] [PATCH 00/11] Simplify system dependent URCU code Paolo Bonzini
2010-02-13 17:16 ` [ltt-dev] [PATCH 01/11] use kernel style makefile output Paolo Bonzini
2010-02-14 14:25 ` Mathieu Desnoyers
2010-02-13 17:16 ` [ltt-dev] [PATCH 02/11] use autoconf symbolic linking Paolo Bonzini
2010-02-14 14:25 ` Mathieu Desnoyers
2010-02-13 17:16 ` [ltt-dev] [PATCH 03/11] add urcu/arch_defaults.h Paolo Bonzini
2010-02-14 14:34 ` Mathieu Desnoyers
2010-02-15 7:53 ` Paolo Bonzini
2010-02-15 14:46 ` Mathieu Desnoyers
2010-02-13 17:16 ` [ltt-dev] [PATCH 04/11] define sync_core for x86 PIC Paolo Bonzini
2010-02-14 14:37 ` Mathieu Desnoyers
2010-02-15 8:10 ` Paolo Bonzini
2010-02-15 14:56 ` Mathieu Desnoyers
2010-02-13 17:16 ` [ltt-dev] [PATCH 05/11] __SIZEOF_LONG__ is always defined by GCC Paolo Bonzini
2010-02-14 14:38 ` Mathieu Desnoyers
2010-02-15 7:54 ` Paolo Bonzini
2010-02-13 17:16 ` [ltt-dev] [PATCH 06/11] remove compat_uatomic_cmpxchg #define from non-x86 Paolo Bonzini
2010-02-14 14:38 ` Mathieu Desnoyers
2010-02-13 17:16 ` [ltt-dev] [PATCH 07/11] add uatomic_gcc.h, use it for default definitions Paolo Bonzini
2010-02-14 14:45 ` Mathieu Desnoyers
2010-02-15 8:05 ` Paolo Bonzini [this message]
2010-02-15 14:55 ` Mathieu Desnoyers
2010-02-15 15:38 ` Paolo Bonzini
2010-02-15 16:23 ` Mathieu Desnoyers
2010-02-15 16:36 ` Paolo Bonzini
2010-02-15 16:51 ` Mathieu Desnoyers
2010-02-15 16:55 ` Paolo Bonzini
2010-02-15 17:13 ` Mathieu Desnoyers
2010-02-15 8:06 ` Paolo Bonzini
2010-02-13 17:16 ` [ltt-dev] [PATCH 08/11] use uatomic_gcc.h Paolo Bonzini
2010-02-13 17:16 ` [ltt-dev] [PATCH 09/11] move whether atomic byte/short exists to uatomic_arch_*.h Paolo Bonzini
2010-02-13 17:16 ` [ltt-dev] [PATCH 10/11] add Alpha support Paolo Bonzini
2010-02-13 17:16 ` [ltt-dev] [PATCH 11/11] support compiling on unknown architectures Paolo Bonzini
2010-02-13 17:16 ` [ltt-dev] [PATCH 12/11] test uatomic_gcc.h Paolo Bonzini
2010-02-14 14:25 ` [ltt-dev] [PATCH 00/11] Simplify system dependent URCU code Mathieu Desnoyers
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=4B79004C.7090407@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