urcu.git
13 years agoRename all memory primitives with prefix cmm_
David Goulet [Thu, 18 Nov 2010 20:45:20 +0000 (15:45 -0500)] 
Rename all memory primitives with prefix cmm_

In order to not pollute the userspace namespace for application
using liburcu or any lib/apps linked with urcu, this patch if the
first of three major refactor for naming convention.

The cmm_ prefix is a short name for Concurrent Memory Model and was
suggested by Mathieu Desnoyers and Paul E. Mckenney. Every memory
primitives such as mb, wmb, rmb, and so on are renamed.

Signed-off-by: David Goulet <david.goulet@polymtl.ca>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
13 years agoAdd missing test binaries to .gitignore
David Goulet [Mon, 15 Nov 2010 19:12:00 +0000 (14:12 -0500)] 
Add missing test binaries to .gitignore

Signed-off-by: David Goulet <david.goulet@polymtl.ca>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
13 years agoAdd config.h and stamp-h2 to gitignore
David Goulet [Sat, 13 Nov 2010 14:30:04 +0000 (09:30 -0500)] 
Add config.h and stamp-h2 to gitignore

Signed-off-by: David Goulet <david.goulet@polymtl.ca>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
13 years agoAdd compiler barriers to read-side for mutex ordering
Mathieu Desnoyers [Sat, 6 Nov 2010 19:09:29 +0000 (15:09 -0400)] 
Add compiler barriers to read-side for mutex ordering

Ensure that mutex acquisition/release is not reordered wrt rcu read lock/unlock.
No impact in practice because pthreads lock/unlock primitives act as memory
barriers. But we should provide the same guarantees we are expecting from other
locking primitives, hence this modification.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
13 years agoFix missing urcu_ref.h in Makefile.am v0.4.8
Mathieu Desnoyers [Fri, 24 Sep 2010 20:48:19 +0000 (16:48 -0400)] 
Fix missing urcu_ref.h in Makefile.am

The 0.4.7 tarball is missing 'urcu/urcu_ref.h', causing the following
error:

      CC     rculfqueue.lo
    In file included from rculfqueue.c:26:
    urcu/rculfqueue.h:26:22: error: urcu_ref.h: No such file or directory
    In file included from rculfqueue.c:26:
    urcu/rculfqueue.h:45: error: field ‘ref’ has incomplete type
    In file included from rculfqueue.c:27:
    urcu/rculfqueue-static.h:29:27: error: urcu/urcu_ref.h: No such file or directory

Reported-by: Jon Bernard <jbernard@debian.org>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
13 years agoupdate version to 0.4.7 v0.4.7
Mathieu Desnoyers [Wed, 22 Sep 2010 20:08:47 +0000 (16:08 -0400)] 
update version to 0.4.7

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
13 years agourcu lfstack: pop needs rcu read lock
Mathieu Desnoyers [Wed, 25 Aug 2010 15:16:34 +0000 (11:16 -0400)] 
urcu lfstack: pop needs rcu read lock

The pop side needs to hold the RCU read lock to deal with ABA problem.
The push side does not need to hold the RCU read lock because even if the next
item is changed to the same value initially read, the stack will still be
consistent.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
13 years agolfstack: simplification
Mathieu Desnoyers [Wed, 25 Aug 2010 14:14:19 +0000 (10:14 -0400)] 
lfstack: simplification

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
13 years agorculfstack: LGPL-ize
Mathieu Desnoyers [Sun, 22 Aug 2010 14:21:19 +0000 (10:21 -0400)] 
rculfstack: LGPL-ize

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
13 years agorculfqueue: LGPL-ize
Mathieu Desnoyers [Sun, 22 Aug 2010 13:21:58 +0000 (09:21 -0400)] 
rculfqueue: LGPL-ize

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
13 years agoadd missing comment to wfstack.c
Mathieu Desnoyers [Sun, 22 Aug 2010 13:08:47 +0000 (09:08 -0400)] 
add missing comment to wfstack.c

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
13 years agowfstack: LGPL-ize
Mathieu Desnoyers [Sun, 22 Aug 2010 12:52:13 +0000 (08:52 -0400)] 
wfstack: LGPL-ize

Create wrapper symbols for LGPL linking.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
13 years agowfqueue: provide API for caller-locked dequeue
Mathieu Desnoyers [Sun, 22 Aug 2010 12:44:41 +0000 (08:44 -0400)] 
wfqueue: provide API for caller-locked dequeue

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
13 years agoLGPL-ize wfqueue
Mathieu Desnoyers [Sun, 22 Aug 2010 12:34:03 +0000 (08:34 -0400)] 
LGPL-ize wfqueue

Provide the appropriate wrappers to ensure that non-LGPL applications can use
the half-blocking wait-free queue.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
13 years agoWF queue cleanup
Mathieu Desnoyers [Wed, 18 Aug 2010 14:55:55 +0000 (10:55 -0400)] 
WF queue cleanup

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
13 years agoWait-free stack: rcu-less implementation
Mathieu Desnoyers [Wed, 18 Aug 2010 14:55:14 +0000 (10:55 -0400)] 
Wait-free stack: rcu-less implementation

Don't have to hold a rcu read lock anymore. pop side is blocking and holds a
mutex.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
13 years agoWait-free queue: wait-free enqueue, blocking dequeue without RCU dependency
Mathieu Desnoyers [Wed, 18 Aug 2010 14:18:58 +0000 (10:18 -0400)] 
Wait-free queue: wait-free enqueue, blocking dequeue without RCU dependency

Implementation better suited for supporting call_rcu().

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
13 years agoRCU lf queue/stack: update comments
Mathieu Desnoyers [Wed, 18 Aug 2010 13:16:08 +0000 (09:16 -0400)] 
RCU lf queue/stack: update comments

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
13 years agoifdef C, wait-free stack adaptative pop wait
Mathieu Desnoyers [Tue, 13 Jul 2010 22:21:33 +0000 (18:21 -0400)] 
ifdef C, wait-free stack adaptative pop wait

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
13 years agourcu static coding style fix (whitespace)
Mathieu Desnoyers [Tue, 13 Jul 2010 22:21:10 +0000 (18:21 -0400)] 
urcu static coding style fix (whitespace)

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
13 years agoCoding style fix
Mathieu Desnoyers [Tue, 13 Jul 2010 21:58:50 +0000 (17:58 -0400)] 
Coding style fix

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
13 years agoRCU wait-free stack: add _blocking in pop() primitive name
Mathieu Desnoyers [Tue, 13 Jul 2010 21:12:49 +0000 (17:12 -0400)] 
RCU wait-free stack: add _blocking in pop() primitive name

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
13 years agoRCU lock-free queue comment updates
Mathieu Desnoyers [Tue, 13 Jul 2010 21:12:13 +0000 (17:12 -0400)] 
RCU lock-free queue comment updates

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
13 years agoRCU wait-free enqueue/blocking dequeue queue
Mathieu Desnoyers [Tue, 13 Jul 2010 21:11:30 +0000 (17:11 -0400)] 
RCU wait-free enqueue/blocking dequeue queue

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
13 years agoAdd ifdef cond around headers
Mathieu Desnoyers [Tue, 13 Jul 2010 20:31:47 +0000 (16:31 -0400)] 
Add ifdef cond around headers

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
13 years agoRCU lock-free queue: don't hold RCU read lock across retry
Mathieu Desnoyers [Tue, 13 Jul 2010 15:59:55 +0000 (11:59 -0400)] 
RCU lock-free queue: don't hold RCU read lock across retry

Be nicer to grace periods.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
13 years agoRCU lock-free stack: don't hold read lock across retry
Mathieu Desnoyers [Tue, 13 Jul 2010 15:57:30 +0000 (11:57 -0400)] 
RCU lock-free stack: don't hold read lock across retry

Be nicer to grace-periods.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
13 years agoWait-free push/Blocking pop stack: Update following Paul's review
Mathieu Desnoyers [Tue, 13 Jul 2010 15:53:30 +0000 (11:53 -0400)] 
Wait-free push/Blocking pop stack: Update following Paul's review

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
13 years agoAdd lock-free queue comments from Paul's review
Mathieu Desnoyers [Tue, 13 Jul 2010 15:53:16 +0000 (11:53 -0400)] 
Add lock-free queue comments from Paul's review

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
13 years agoAdd wait-free push/blocking pop stack
Mathieu Desnoyers [Tue, 13 Jul 2010 00:54:52 +0000 (20:54 -0400)] 
Add wait-free push/blocking pop stack

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
13 years agoLock-free stack: add comments
Mathieu Desnoyers [Mon, 12 Jul 2010 16:29:11 +0000 (12:29 -0400)] 
Lock-free stack: add comments

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
13 years agoAdd lock-free RCU queue and stack
Mathieu Desnoyers [Mon, 12 Jul 2010 16:16:30 +0000 (12:16 -0400)] 
Add lock-free RCU queue and stack

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
13 years agoUpdate version to 0.4.6 v0.4.6
Mathieu Desnoyers [Fri, 18 Jun 2010 16:47:46 +0000 (12:47 -0400)] 
Update version to 0.4.6

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
13 years agoUpdate README for ARM support
Mathieu Desnoyers [Fri, 18 Jun 2010 16:47:24 +0000 (12:47 -0400)] 
Update README for ARM support

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
13 years agoUpdate version to 0.4.5 v0.4.5
Mathieu Desnoyers [Fri, 18 Jun 2010 16:38:39 +0000 (12:38 -0400)] 
Update version to 0.4.5

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
13 years agoUpdate email address from @polymtl.ca to @efficios.com
Mathieu Desnoyers [Fri, 18 Jun 2010 16:35:26 +0000 (12:35 -0400)] 
Update email address from @polymtl.ca to @efficios.com

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
13 years agoForce build failure on unknown architectures
Paul E. McKenney [Fri, 18 Jun 2010 16:26:20 +0000 (12:26 -0400)] 
Force build failure on unknown architectures

Create urcu/arch_unknown.h and urcu/uatomic_arch_unknown.h, which
contain only #error statements and explanatory comments.  This forces
build failures on unrecognized architectures in preference to trying
to guess at what operations might be safe on such architectures.

One other semi-feasible alternative is to use hashed arrays of locks
that are acquired with signals disabled.  However, this seems a bit
too ornate, especially for architectures for which the gcc __sync_
primitives work correctly.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
13 years agoAdd native ARM port for armv7l
Paul E. McKenney [Fri, 18 Jun 2010 16:25:08 +0000 (12:25 -0400)] 
Add native ARM port for armv7l

Add native support for armv7l.  Other variants of ARM will likely require
separate ports.  The gcc __sync_ approach works back to at least 2.6.15
kernels.

As suggested by Paolo Bonzini, defer the definition of CACHE_LINE_SIZE
to arch_generic.h.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
13 years agoAdd ia64 architecture based on gcc primitives
Paul E. McKenney [Fri, 18 Jun 2010 16:06:19 +0000 (12:06 -0400)] 
Add ia64 architecture based on gcc primitives

This of course assumes that ia64 gcc correctly implements the various
__sync_ primitives.  ;-)

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
13 years agoAdd header files supporting gcc __sync_ primitives
Paul E. McKenney [Fri, 18 Jun 2010 16:05:12 +0000 (12:05 -0400)] 
Add header files supporting gcc __sync_ primitives

Add a urcu/arch_gcc.h and urcu/uatomic_arch_gcc.h whose primitives are
based on the gcc __sync_ primitives.  This should be usable for all
systems that have correctly implemented __sync_ primitives, which sadly
does not include all combinations of systems and compilers.  In addition,
specific systems may gain higher performance with hand-coded primitives.
Nevertheless, this is nice for getting a new architecture up and running
quickly.

As suggested by Paolo Bonzini, defer the definition of mb() to the common
arch_generic.h file, and also defer the uatomic*() primitives to
uatomic_generic.h.

[Mathieu : fixed arch_gcc.h header which contained incorrect arch_unknown.h in
           header.]

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
13 years agoAdd test cycles per loop
Mathieu Desnoyers [Sun, 13 Jun 2010 23:55:41 +0000 (19:55 -0400)] 
Add test cycles per loop

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
13 years agoAdd uatomic test to make check
Mathieu Desnoyers [Sun, 13 Jun 2010 22:44:04 +0000 (18:44 -0400)] 
Add uatomic test to make check

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
13 years agoRemove unused sync_core() definitions
Paul E. McKenney [Sun, 13 Jun 2010 21:30:04 +0000 (17:30 -0400)] 
Remove unused sync_core() definitions

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
13 years agoUpdate version to 0.4.4 v0.4.4
Mathieu Desnoyers [Thu, 20 May 2010 22:12:11 +0000 (18:12 -0400)] 
Update version to 0.4.4

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
13 years agoFix powerpc uatomic 4-byte cmpxchg (cmpd -> cmpw)
Mathieu Desnoyers [Thu, 20 May 2010 22:09:20 +0000 (18:09 -0400)] 
Fix powerpc uatomic 4-byte cmpxchg (cmpd -> cmpw)

Necessary to make it work on 32-bit only powerpc architectures. Was using the
64-bit comparison rather than the 32-bit comparison for 4-byte cmpxchg.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
13 years agourcu-qsbr: use same ongoing helper for 32 and 64 bits
Mathieu Desnoyers [Fri, 14 May 2010 00:15:10 +0000 (20:15 -0400)] 
urcu-qsbr: use same ongoing helper for 32 and 64 bits

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
14 years ago"make check" runs the test suite
Giuseppe Scrivano [Tue, 20 Apr 2010 13:08:16 +0000 (09:08 -0400)] 
"make check" runs the test suite

a trivial patch to enable the Makefile "check" rule.

Signed-off-by: Giuseppe Scrivano <gscrivano@gnu.org>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
14 years agoSimplify qsbr online condition
Mathieu Desnoyers [Wed, 14 Apr 2010 16:56:53 +0000 (12:56 -0400)] 
Simplify qsbr online condition

Alan Stern wrote:

>       return v && (v - rcu_gp_ctr > ULONG_MAX / 2);
>
> Wouldn't it be better to write:
>
>       return v != 0 && v != rcu_gp_ctr;
>
> or something equivalent?  The point is, it's foolish to return 0 when
> rcu_gp_ctr has wrapped around to below v.  This can happen only when
> rcu_thread_online() is delayed (as by preemption), in which case we
> know that there's a good chance the algorithm will fail.  My version of
> the test eliminates the possibility of this failure, although it
> doesn't eliminate the possibility that rcu_gp_ctr has wrapped around so
> far that it is equal to v.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
14 years agoCleanup: head -> node field name
Mathieu Desnoyers [Wed, 14 Apr 2010 16:37:15 +0000 (12:37 -0400)] 
Cleanup: head -> node field name

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
14 years agoUpdate urcu and urcu-qsbr, make compiler barriers explicit
Mathieu Desnoyers [Wed, 17 Mar 2010 13:31:26 +0000 (09:31 -0400)] 
Update urcu and urcu-qsbr, make compiler barriers explicit

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
14 years agourcu: Add extra "engineering safety factor" memory barrier in update_counter_and_wait()
Mathieu Desnoyers [Sun, 14 Mar 2010 19:33:51 +0000 (15:33 -0400)] 
urcu: Add extra "engineering safety factor" memory barrier in update_counter_and_wait()

Even though the memory barriers within update_counter_and_wait() are proven not
to be needed in urcu-mb/signal/qsbr implementations, we leave them in place as
an engineering safety factor. Basically, we've proven they are not required
(formally for urcu-mb and urcu-signal by model checking, less formally for
urcu-qsbr by looking at the execution order of concurrent synchronize_rcu() and
RCU read-sides with out-of-order load/stores). However, given that on the
overall performance impact of synchronize_rcu(), these memory barriers do not
add a significant overhead, let's leave them in place with a comment stating
that they are not required.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
14 years agourcu-qsbr: document compiler barrier
Mathieu Desnoyers [Sun, 14 Mar 2010 14:27:23 +0000 (10:27 -0400)] 
urcu-qsbr: document compiler barrier

This compiler barrier is, at the implementation level, already provided by the
volatile accesses for STORE/LOAD_SHARED. However, given that these primitives
does not provide this guarantee at the high-level (and might use lighter gcc
primitives eventually), we need to add an explicit barrier().

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
14 years agoupdate version to 0.4.3 v0.4.3
Mathieu Desnoyers [Sun, 7 Mar 2010 02:07:18 +0000 (21:07 -0500)] 
update version to 0.4.3

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
14 years agoFix typo in urcu/uatomic_generic.h
Jon Bernard [Sun, 7 Mar 2010 02:06:36 +0000 (21:06 -0500)] 
Fix typo in urcu/uatomic_generic.h

Signed-off-by: Jon Bernard <jbernard@debian.org>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
14 years agoUpdate version to 0.4.2 v0.4.2
Mathieu Desnoyers [Thu, 4 Mar 2010 19:57:57 +0000 (14:57 -0500)] 
Update version to 0.4.2

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
14 years agoUpdate README
Mathieu Desnoyers [Thu, 4 Mar 2010 14:54:51 +0000 (09:54 -0500)] 
Update README

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
14 years agourcu-bp: reset ctr to 0 upon garbage collection
Mathieu Desnoyers [Wed, 3 Mar 2010 14:08:30 +0000 (09:08 -0500)] 
urcu-bp: reset ctr to 0 upon garbage collection

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
14 years agocompiler.h: add () in ACCESS_ONCE()
Mathieu Desnoyers [Tue, 2 Mar 2010 16:41:01 +0000 (11:41 -0500)] 
compiler.h: add () in ACCESS_ONCE()

Protect x in ACCESS_ONCE macro.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
14 years agourcu-defer: remove "ratelimit" leftover
Mathieu Desnoyers [Tue, 2 Mar 2010 16:36:49 +0000 (11:36 -0500)] 
urcu-defer: remove "ratelimit" leftover

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
14 years agoUpdate readme: ia64 and alpha support
Mathieu Desnoyers [Tue, 2 Mar 2010 16:18:30 +0000 (11:18 -0500)] 
Update readme: ia64 and alpha support

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
14 years agoInstall missing arch_generic.h
Mathieu Desnoyers [Tue, 2 Mar 2010 16:08:19 +0000 (11:08 -0500)] 
Install missing arch_generic.h

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
14 years agourcu: fix multiple register/unregister assertion failure
Mathieu Desnoyers [Mon, 1 Mar 2010 21:42:15 +0000 (16:42 -0500)] 
urcu: fix multiple register/unregister assertion failure

Caused by the fact that we check for the whole gp count (which includes the last
grace period phase bit) rather than just checking if the nesting count mask is
zero.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
14 years agotest cases: add multiple register/unregister tests
Mathieu Desnoyers [Mon, 1 Mar 2010 21:41:51 +0000 (16:41 -0500)] 
test cases: add multiple register/unregister tests

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
14 years agocentralize definition of BITS_PER_LONG
Paolo Bonzini [Mon, 1 Mar 2010 19:12:21 +0000 (14:12 -0500)] 
centralize definition of BITS_PER_LONG

Use __SIZEOF_LONG__, defined by GCC 4.3 or later, or _LP64, defined
by GCC 3.4 or later.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
14 years agoavoid multiple evaluation of STORE_SHARED argument
Paolo Bonzini [Mon, 1 Mar 2010 19:06:01 +0000 (14:06 -0500)] 
avoid multiple evaluation of STORE_SHARED argument

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
14 years agosupport compiling on unknown architectures
Paolo Bonzini [Mon, 1 Mar 2010 19:04:11 +0000 (14:04 -0500)] 
support compiling on unknown architectures

The new defaults mean that, for example, ia64 support comes for free.

[edit by Mathieu Desnoyers]

defaults -> generic

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
14 years agoadd Alpha support
Paolo Bonzini [Mon, 1 Mar 2010 19:02:55 +0000 (14:02 -0500)] 
add Alpha support

And you already know what needs to be special-cased for Alpha...

[edit by Mathieu Desnoyers]

defaults -> generic

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
14 years agomove whether atomic byte/short exists to uatomic_arch_*.h
Paolo Bonzini [Mon, 1 Mar 2010 19:00:22 +0000 (14:00 -0500)] 
move whether atomic byte/short exists to uatomic_arch_*.h

And add more generic implementations to uatomic_defaults.h.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
14 years agouse uatomic_generic.h for common fallback implementations
Paolo Bonzini [Mon, 1 Mar 2010 18:58:45 +0000 (13:58 -0500)] 
use uatomic_generic.h for common fallback implementations

And now, really remove the code for S390/SPARC, using the fallback
implementation of uatomic_generic.h

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
14 years agoadd uatomic_generic.h, use it for common definitions
Paolo Bonzini [Mon, 1 Mar 2010 18:57:00 +0000 (13:57 -0500)] 
add uatomic_generic.h, use it for common definitions

uatomic_generic.h can be included by uatomic_arch_*.h to provide useful
default definitions.  uatomic_arch_*.h can define whatever builtins
it wants to override, then uatomic_generic.h will provide what is not
already defined, as follows:

- uatomic_cmpxchg will use __sync_val_compare_and_swap builtins;

- uatomic_add_return will use __sync_fetch_and_add if uatomic_arch_*.h
did not provide a definition of uatomic_cmpxchg.  If it did, we assume
__sync builtins are buggy or otherwise undesirable on this platform,
so uatomic_generic.h will implement uatomic_add_return in terms of
uatomic_cmpxchg too.

- uatomic_xchg is like uatomic_add_return.  However, since GCC does
not provide an adequate builtin, it needs to use a compare-and-swap
loop using __sync_bool_compare_and_swap if uatomic_cmpxchg is not
provided.

- uatomic_sub_return/uatomic_add/uatomic_sub will be implemented
in terms of uatomic_add_return;

- uatomic_inc/uatomic_dec will be implemented in terms of uatomic_add.

After this patch, uatomic_generic.h is already used for the latter two
categories.  The next patch will use uatomic_generic.h whenever there is
no assembly code involved, or otherwise it makes no difference to use
uatomic_generic.h.  We keep custom per-arch macros to provide support for
compilers back to early GCC 3.x versions; however future ports may
not have this limitation.

The hunk in tests/test_uatomic.c is only needed for bisectability
and will be removed later.

[edit by Mathieu Desnoyers]

Fixed Makefile.am conflict.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
14 years agoremove compat_uatomic_cmpxchg #define from non-x86
Paolo Bonzini [Mon, 1 Mar 2010 18:53:51 +0000 (13:53 -0500)] 
remove compat_uatomic_cmpxchg #define from non-x86

This is unused everywhere except on x86.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
14 years agodefine sync_core for x86 PIC
Paolo Bonzini [Mon, 1 Mar 2010 18:52:45 +0000 (13:52 -0500)] 
define sync_core for x86 PIC

Pushing/popping the reserved ebx register is surely less expensive
than a memory barrier.

Note that since ebx is a callee-save register, this is even safe for
signals (i.e. it would be safe even if we needed the value that cpuid
puts in %%ebx).

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
14 years agoadd urcu/arch_generic.h
Paolo Bonzini [Mon, 1 Mar 2010 18:51:14 +0000 (13:51 -0500)] 
add urcu/arch_generic.h

Most of the memory barrier definitions are shared between all
architectures, especially smp_* and mc/rmc/wmc.  Put them in
a common file.

[edit by Mathieu Desnoyers]

+ * arch_defaults.h: common definitions for multiple architectures.
 becomes
+ * arch_generic.h: common definitions for multiple architectures.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
14 years agouse autoconf symbolic linking
Paolo Bonzini [Mon, 1 Mar 2010 18:50:32 +0000 (13:50 -0500)] 
use autoconf symbolic linking

Instead of copying.  This is less error-prone while developing and
lets Automake handle more stuff.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
14 years agouse kernel style makefile output
Paolo Bonzini [Mon, 1 Mar 2010 18:49:54 +0000 (13:49 -0500)] 
use kernel style makefile output

A breath of fresh air.  Requires Automake 1.11, but the
patch degrades gracefully.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
14 years agoupdate README for urcu-signal
Mathieu Desnoyers [Fri, 19 Feb 2010 22:20:24 +0000 (17:20 -0500)] 
update README for urcu-signal

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
14 years agolist: new -> _new for c++ compatibility
Mathieu Desnoyers [Fri, 19 Feb 2010 14:28:41 +0000 (09:28 -0500)] 
list: new -> _new for c++ compatibility

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
14 years agorcuhlist: add head name fix
Mathieu Desnoyers [Fri, 19 Feb 2010 14:08:18 +0000 (09:08 -0500)] 
rcuhlist: add head name fix

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
14 years agoRCU list: add rcuhlist.h, add list_replace_rcu
Mathieu Desnoyers [Fri, 19 Feb 2010 04:45:40 +0000 (23:45 -0500)] 
RCU list: add rcuhlist.h, add list_replace_rcu

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
14 years agotests: update writer cs len script for 64-core ppc
Mathieu Desnoyers [Sun, 14 Feb 2010 15:07:43 +0000 (10:07 -0500)] 
tests: update writer cs len script for 64-core ppc

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
14 years agotests: update summary
Mathieu Desnoyers [Sun, 14 Feb 2010 14:06:47 +0000 (09:06 -0500)] 
tests: update summary

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
14 years agourcu tests: add writer duration parameter
Mathieu Desnoyers [Sun, 14 Feb 2010 13:43:05 +0000 (08:43 -0500)] 
urcu tests: add writer duration parameter

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
14 years agoUpdate to version 0.4.1 v0.4.1
Mathieu Desnoyers [Fri, 12 Feb 2010 22:52:50 +0000 (17:52 -0500)] 
Update to version 0.4.1

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
14 years agourcu-static.h: use SYS_membarrier rather than __NR_membarrier
Mathieu Desnoyers [Fri, 12 Feb 2010 21:39:22 +0000 (16:39 -0500)] 
urcu-static.h: use SYS_membarrier rather than __NR_membarrier

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
14 years agos390: fix arch_s390.h include of urcu/compiler.h
Mathieu Desnoyers [Fri, 12 Feb 2010 01:11:44 +0000 (20:11 -0500)] 
s390: fix arch_s390.h include of urcu/compiler.h

gcc -DHAVE_CONFIG_H -I. -I.. -I../urcu    -DTORTURE_URCU -I.. -I.. -g -O2 -c -o rcutorture_urcu-urcutorture.o `test -f 'urcutorture.c' || echo './'`urcutorture.c
/bin/sh ../libtool --tag=CC   --mode=link gcc -DTORTURE_URCU -I.. -I.. -g -O2 -lpthread  -o rcutorture_urcu rcutorture_urcu-urcutorture.o ../urcu.c ../urcu-pointer.c
gcc -DTORTURE_URCU -I.. -I.. -g -O2 -o rcutorture_urcu rcutorture_urcu-urcutorture.o ../urcu.c ../urcu-pointer.c  -lpthread
In file included from ../urcu-static.h:38,
                 from ../urcu.c:36:
../urcu/arch.h:31:22: error: compiler.h: No such file or directory
In file included from ../urcu/system.h:22,
                 from ../urcu/uatomic_arch.h:33,
                 from ../urcu-pointer.c:27:
../urcu/arch.h:31:22: error: compiler.h: No such file or directory
make[3]: *** [rcutorture_urcu] Error 1
make[3]: Leaving directory `/build/buildd-liburcu_0.4.0-1-s390-vwO9c1/liburcu-0.4.0/tests'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/build/buildd-liburcu_0.4.0-1-s390-vwO9c1/liburcu-0.4.0'
make[1]: *** [all] Error 2
dh_auto_build: make -j1 returned exit code 2
make: *** [build] Error 2
dpkg-buildpackage: error: debian/rules build gave error exit status 2
make[1]: Leaving directory `/build/buildd-liburcu_0.4.0-1-s390-vwO9c1/liburcu-0.4.0'

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
14 years agoREADME: discuss mutex vs RCU interaction
Mathieu Desnoyers [Mon, 8 Feb 2010 21:57:57 +0000 (16:57 -0500)] 
README: discuss mutex vs RCU interaction

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
14 years agostandardize rcu_gp_ongoing
Mathieu Desnoyers [Mon, 8 Feb 2010 14:36:41 +0000 (09:36 -0500)] 
standardize rcu_gp_ongoing

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
14 years agorename rcu_old_gp_ongoing to rcu_gp_ongoing
Mathieu Desnoyers [Mon, 8 Feb 2010 14:28:14 +0000 (09:28 -0500)] 
rename rcu_old_gp_ongoing to rcu_gp_ongoing

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
14 years agoupdate LOAD_SHARED/STORE_SHARED for need_mb.
Mathieu Desnoyers [Mon, 8 Feb 2010 14:18:43 +0000 (09:18 -0500)] 
update LOAD_SHARED/STORE_SHARED for need_mb.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
14 years agourcu: use unsigned long instead of long
Mathieu Desnoyers [Mon, 8 Feb 2010 13:18:08 +0000 (08:18 -0500)] 
urcu: use unsigned long instead of long

As it is currently designed, urcu scheme never overflows and we do not use the
upper "sign" bit. But, nevertheless, just in case we choose to do it differently
in the future, use an unsigned long type to allow:

- overflow
- defined used of 0x80000000

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
14 years agoupdate version to 0.4.0 v0.4.0
Mathieu Desnoyers [Sat, 30 Jan 2010 18:29:21 +0000 (13:29 -0500)] 
update version to 0.4.0

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
14 years agoURCU: rename light/heavy barriers to slave/master
Mathieu Desnoyers [Sat, 30 Jan 2010 18:28:35 +0000 (13:28 -0500)] 
URCU: rename light/heavy barriers to slave/master

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
14 years agoQSBR URCU: remove unused reader_barrier() declaration
Mathieu Desnoyers [Sat, 30 Jan 2010 18:21:27 +0000 (13:21 -0500)] 
QSBR URCU: remove unused reader_barrier() declaration

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
14 years agoUpdate comments
Mathieu Desnoyers [Sun, 17 Jan 2010 18:25:06 +0000 (13:25 -0500)] 
Update comments

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
14 years agoInternal cleanup
Mathieu Desnoyers [Sun, 17 Jan 2010 17:15:44 +0000 (12:15 -0500)] 
Internal cleanup

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
14 years agorename internal_rcu_lock() into mutex_lock/unlock(&rcu_gp_lock)
Mathieu Desnoyers [Sun, 17 Jan 2010 16:42:56 +0000 (11:42 -0500)] 
rename internal_rcu_lock() into mutex_lock/unlock(&rcu_gp_lock)

Cleanup.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
14 years agoAdd SIGURCU backward compatibility
Mathieu Desnoyers [Fri, 15 Jan 2010 16:32:35 +0000 (11:32 -0500)] 
Add SIGURCU backward compatibility

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
14 years agoUpdate support for MEMBARRIER_QUERY
Mathieu Desnoyers [Thu, 14 Jan 2010 01:52:52 +0000 (20:52 -0500)] 
Update support for MEMBARRIER_QUERY

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
14 years agoSupport sys_membarrier v6 ABI
Mathieu Desnoyers [Wed, 13 Jan 2010 23:46:53 +0000 (18:46 -0500)] 
Support sys_membarrier v6 ABI

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
14 years agoAdd sys_membarrier() dynamic detection, old liburcu.so -> liburcu-signal.so
Mathieu Desnoyers [Wed, 13 Jan 2010 18:02:21 +0000 (13:02 -0500)] 
Add sys_membarrier() dynamic detection, old liburcu.so -> liburcu-signal.so

See updated README for library renaming details.

liburcu is now dynamically detecting if sys_membarrier is available, and using
urcu-mb as fall back.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
This page took 0.042016 seconds and 4 git commands to generate.