]> git.lttng.org Git - urcu.git/log
urcu.git
15 years agoqsbr: only mark reader thread as being waited for in contended case urcu/yield
Mathieu Desnoyers [Sat, 26 Sep 2009 22:29:37 +0000 (18:29 -0400)] 
qsbr: only mark reader thread as being waited for in contended case

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
15 years agoDon't mark reader thread as being waited for if non-contended
Mathieu Desnoyers [Sat, 26 Sep 2009 22:26:50 +0000 (18:26 -0400)] 
Don't mark reader thread as being waited for if non-contended

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
15 years agourcu-qsbr: repeat sched_yield() loop, yield at offline rather than online.
Mathieu Desnoyers [Sat, 26 Sep 2009 19:10:04 +0000 (15:10 -0400)] 
urcu-qsbr: repeat sched_yield() loop, yield at offline rather than online.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
15 years agoOnly make the threads for which we are waiting call sched_yield()
Mathieu Desnoyers [Sat, 26 Sep 2009 17:55:30 +0000 (13:55 -0400)] 
Only make the threads for which we are waiting call sched_yield()

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
15 years agoImplement sched_yield UP support
Mathieu Desnoyers [Sat, 26 Sep 2009 13:31:12 +0000 (09:31 -0400)] 
Implement sched_yield UP support

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
15 years agoAdd multiple reader queues to futex model urcu/futex
Mathieu Desnoyers [Sat, 26 Sep 2009 12:19:26 +0000 (08:19 -0400)] 
Add multiple reader queues to futex model

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
15 years agoCleanup promela code for wakeup verif
Mathieu Desnoyers [Sat, 26 Sep 2009 12:13:20 +0000 (08:13 -0400)] 
Cleanup promela code for wakeup verif

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
15 years agoRemove stale file
Mathieu Desnoyers [Sat, 26 Sep 2009 07:05:05 +0000 (03:05 -0400)] 
Remove stale file

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
15 years agoAdd multicoreverif paper ticketlock and spinlock models
Mathieu Desnoyers [Sat, 26 Sep 2009 06:53:44 +0000 (02:53 -0400)] 
Add multicoreverif paper ticketlock and spinlock models

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
15 years agoAdd futex wakeup spin model
Mathieu Desnoyers [Sat, 26 Sep 2009 06:51:04 +0000 (02:51 -0400)] 
Add futex wakeup spin model

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
15 years agoAdd futex support to accelerate synchronize_rcu() on UP
Mathieu Desnoyers [Fri, 25 Sep 2009 21:49:31 +0000 (17:49 -0400)] 
Add futex support to accelerate synchronize_rcu() on UP

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
15 years agourcu-defer: fix futex wakeup value urcu/busyloop
Mathieu Desnoyers [Thu, 24 Sep 2009 00:55:52 +0000 (20:55 -0400)] 
urcu-defer: fix futex wakeup value

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
15 years agoRemove extra LDFLAGS from makefile
Mathieu Desnoyers [Thu, 24 Sep 2009 00:18:28 +0000 (20:18 -0400)] 
Remove extra LDFLAGS from makefile

> cc: -lpthread: linker input file unused because linking not done

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
15 years agoAdd missing include compiler.h
Mathieu Desnoyers [Thu, 24 Sep 2009 00:16:14 +0000 (20:16 -0400)] 
Add missing include compiler.h

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
15 years agorcu torture and api.h: remove duplicated atomic primitives
Mathieu Desnoyers [Thu, 24 Sep 2009 00:10:51 +0000 (20:10 -0400)] 
rcu torture and api.h: remove duplicated atomic primitives

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
15 years agotest_atomic: test for byte/short atomic support
Mathieu Desnoyers [Thu, 24 Sep 2009 00:00:58 +0000 (20:00 -0400)] 
test_atomic: test for byte/short atomic support

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
15 years agoppc atomic: fix atomic_dec/inc
Mathieu Desnoyers [Wed, 23 Sep 2009 23:23:48 +0000 (19:23 -0400)] 
ppc atomic: fix atomic_dec/inc

Only require 1 arg.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
15 years agourcu-defer: remove dependency on linux/futex.h
Mathieu Desnoyers [Wed, 23 Sep 2009 23:21:56 +0000 (19:21 -0400)] 
urcu-defer: remove dependency on linux/futex.h

> cc -fPIC -Wall -I. -O2 -g -lpthread -c -o urcu-defer.o `echo urcu-defer.c urcu-defer.h | sed 's/[^ ]*\.h//g'`
> In file included from urcu-defer.c:31:
> /usr/include/linux/futex.h:96: error: expected ‘)’ before ‘*’ token
> /usr/include/linux/futex.h:100: error: expected ‘)’ before ‘*’ token

Seems broken on ppc. Just for two defines, it's not worth depending on it.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
15 years agourcu: Move urcu_init within ifdef
Mathieu Desnoyers [Wed, 23 Sep 2009 23:18:06 +0000 (19:18 -0400)] 
urcu: Move urcu_init within ifdef

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
15 years agoatomic ppc: fix missing casts and inline
Mathieu Desnoyers [Wed, 23 Sep 2009 23:16:57 +0000 (19:16 -0400)] 
atomic ppc: fix missing casts and inline

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
15 years agourcu-defer: ensure callbacks will never be enqueued forever
Mathieu Desnoyers [Wed, 23 Sep 2009 22:29:21 +0000 (18:29 -0400)] 
urcu-defer: ensure callbacks will never be enqueued forever

Even if there are no further callbacks enqueued, ensure that after a 100ms
delay, the callback queue will be dealt with.

Required proper ordering of queue vs futex.

e.g.

 The idea is to perform the "check for empty queue" between the
&defer_thread_futex decrement and the test in wait_defer. It skips the
futex call and proceed if the list is non-empty.

As I am drilling into the problem, it looks very much like an attempt to
implement efficient wait queues in userspace based on sys_futex().

/*
 * Wake-up any waiting defer thread. Called from many concurrent
 * threads.
 */
static void wake_up_defer(void)
{
        if (unlikely(atomic_read(&defer_thread_futex) == -1)) {
                atomic_set(&defer_thread_futex, 0);
                futex(&defer_thread_futex, FUTEX_WAKE, 0,
                      NULL, NULL, 0);
        }
}

/*
 * Defer thread waiting. Single thread.
 */
static void wait_defer(void)
{
        atomic_dec(&defer_thread_futex);
        smp_mb();       /* Write futex before read queue */
        if (rcu_defer_num_callbacks()) {
                smp_mb();       /* Read queue before write futex */
                /* Callbacks are queued, don't wait. */
                atomic_set(&defer_thread_futex, 0);
        } else {
                smp_rmb();      /* Read queue before read futex */
                if (atomic_read(&defer_thread_futex) == -1)
                        futex(&defer_thread_futex, FUTEX_WAIT, -1,
                              NULL, NULL, 0);
        }
}

- call_rcu():
  * queue callbacks to perform
  * smp_mb()
  * wake_up_defer()

- defer thread:
  * for (;;)
    * wait_defer()
    * sleep 100ms (wait for more callbacks to be enqueued)
    * dequeue callbacks, execute them

The goal here is that if call_rcu() enqueues a callback (even if it
races with defer thread going to sleep), there should not be a
potentially infinite delay before it gets executed. Therefore, being
blocked in sys_futex while there is a callback to execute, without any
hope to be woken up unless another callback is queued, would not meet
that design requirement. I think that checking the number of queued
callbacks within wait_defer() as I propose here should address this
situation.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
15 years agoFix urcu-defer: add missing brackets.
Mathieu Desnoyers [Wed, 23 Sep 2009 21:23:29 +0000 (17:23 -0400)] 
Fix urcu-defer: add missing brackets.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
15 years agoCleanup: remove debug code form urcu-defer.c
Mathieu Desnoyers [Wed, 23 Sep 2009 17:34:31 +0000 (13:34 -0400)] 
Cleanup: remove debug code form urcu-defer.c

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
15 years agoMove urcu_defer_queue to urcu-defer.c
Mathieu Desnoyers [Wed, 23 Sep 2009 17:21:45 +0000 (13:21 -0400)] 
Move urcu_defer_queue to urcu-defer.c

Too big to be inline.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
15 years agourcu-defer: make call_rcu() energy efficient using futex()
Mathieu Desnoyers [Wed, 23 Sep 2009 17:14:34 +0000 (13:14 -0400)] 
urcu-defer: make call_rcu() energy efficient using futex()

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
15 years agoAdd offsetof to compiler.h
Mathieu Desnoyers [Wed, 23 Sep 2009 17:13:29 +0000 (13:13 -0400)] 
Add offsetof to compiler.h

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
15 years agoppc atomic: Fix asm format.
Paul E. McKenney [Wed, 23 Sep 2009 07:09:59 +0000 (03:09 -0400)] 
ppc atomic: Fix asm format.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
15 years agoadd rcu_cmpxchg_pointer
Mathieu Desnoyers [Tue, 22 Sep 2009 23:01:10 +0000 (19:01 -0400)] 
add rcu_cmpxchg_pointer

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
15 years agoremove volatile from prototypes in atomic code
Mathieu Desnoyers [Tue, 22 Sep 2009 22:52:40 +0000 (18:52 -0400)] 
remove volatile from prototypes in atomic code

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
15 years agoupdate ppc atomic
Mathieu Desnoyers [Tue, 22 Sep 2009 22:51:21 +0000 (18:51 -0400)] 
update ppc atomic

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
15 years agoupdate x86 and ppc atomic ops
Mathieu Desnoyers [Tue, 22 Sep 2009 22:44:26 +0000 (18:44 -0400)] 
update x86 and ppc atomic ops

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
15 years agoAdd powerpc atomic operations
Mathieu Desnoyers [Tue, 22 Sep 2009 22:11:17 +0000 (18:11 -0400)] 
Add powerpc atomic operations

cmpxchg
atomic_add_return
atomic_sub_return
atomic_add
atomic_sub
atomic_inc
atomic_dec

(already had xchg)

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
15 years agoupdate x86_64 cmpxchg
Mathieu Desnoyers [Tue, 22 Sep 2009 20:56:18 +0000 (16:56 -0400)] 
update x86_64 cmpxchg

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
15 years agoUpdate atomic x86_64 cmpxchg
Mathieu Desnoyers [Tue, 22 Sep 2009 21:23:08 +0000 (17:23 -0400)] 
Update atomic x86_64 cmpxchg

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
15 years agomakefile update
Mathieu Desnoyers [Tue, 22 Sep 2009 21:20:56 +0000 (17:20 -0400)] 
makefile update

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
15 years agoAdd inc/dec x86 atomics
Mathieu Desnoyers [Tue, 22 Sep 2009 21:09:55 +0000 (17:09 -0400)] 
Add inc/dec x86 atomics

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
15 years agoupdate x86 atomic, add test atomic
Mathieu Desnoyers [Tue, 22 Sep 2009 20:41:24 +0000 (16:41 -0400)] 
update x86 atomic, add test atomic

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
15 years agoextend x86 atomic operations
Mathieu Desnoyers [Tue, 22 Sep 2009 20:28:49 +0000 (16:28 -0400)] 
extend x86 atomic operations

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
15 years agoAdd missing files in make clean
Mathieu Desnoyers [Mon, 21 Sep 2009 16:26:16 +0000 (12:26 -0400)] 
Add missing files in make clean

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
15 years agourcu-defer: remove unnecessary memory barrier
Mathieu Desnoyers [Sun, 20 Sep 2009 16:03:37 +0000 (12:03 -0400)] 
urcu-defer: remove unnecessary memory barrier

All synchronization between queue producer/consumer is performed by the write to
"head". Before this write, none of the queued data is visible from the consumer
point of view.

Therefore, just a single wmb() is required before writing to head to ensure
correct synchronization. This matches with the rmb() after reading head on the
consumer side.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
15 years agourcu-defer: Add fast path for empty queues
Mathieu Desnoyers [Sun, 20 Sep 2009 15:39:30 +0000 (11:39 -0400)] 
urcu-defer: Add fast path for empty queues

defer_barrier does not need to call synchronize_rcu() when all queues are empty.
Skip the G.P. if this is the case.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
15 years agourcu-defer: cleanup debug code
Mathieu Desnoyers [Sun, 20 Sep 2009 15:18:23 +0000 (11:18 -0400)] 
urcu-defer: cleanup debug code

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
15 years agoDeferral test update
Mathieu Desnoyers [Sun, 20 Sep 2009 02:23:11 +0000 (22:23 -0400)] 
Deferral test update

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
15 years agogeneric urcu deferral (call_rcu())
Mathieu Desnoyers [Sun, 20 Sep 2009 02:20:16 +0000 (22:20 -0400)] 
generic urcu deferral (call_rcu())

Found out a way to encode the queues so the standard scenario is to use a single
pointer per call_rcu().

Uses more space for:
- unaligned functions pointers.
- unaligned data pointers.
- function/data value : -2L. (this is arbitrary)

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
15 years agoRename liburcu-reclaim to liburcu-defer
Mathieu Desnoyers [Sun, 20 Sep 2009 00:05:10 +0000 (20:05 -0400)] 
Rename liburcu-reclaim to liburcu-defer

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
15 years agourcu-reclaim cleanup
Mathieu Desnoyers [Sat, 19 Sep 2009 21:55:47 +0000 (17:55 -0400)] 
urcu-reclaim cleanup

Rename "reader" to "reclaimer", because urcu-reclaim keeps track of "reclaimer"
threads (rcu writers) and has its own reclaiming thread periodically performing
the batch reclamation.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
15 years agoUpdate header heading
Mathieu Desnoyers [Sat, 19 Sep 2009 21:45:41 +0000 (17:45 -0400)] 
Update header heading

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
15 years agoAdd rcu-reclaim.so library
Mathieu Desnoyers [Sat, 19 Sep 2009 21:28:06 +0000 (17:28 -0400)] 
Add rcu-reclaim.so library

Add "automated" RCU memory reclamation.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
15 years agoadd static declarations
Mathieu Desnoyers [Sat, 19 Sep 2009 21:26:41 +0000 (17:26 -0400)] 
add static declarations

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
15 years agoqsbr: Add write+read thread support to 32-bit QSBR
Mathieu Desnoyers [Fri, 18 Sep 2009 13:12:35 +0000 (09:12 -0400)] 
qsbr: Add write+read thread support to 32-bit QSBR

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
15 years agoQSBR: Implement 2-phase grace period for 32-bit arch
Mathieu Desnoyers [Fri, 18 Sep 2009 13:05:03 +0000 (09:05 -0400)] 
QSBR: Implement 2-phase grace period for 32-bit arch

Ensures we never run in overflow on 32-bit arch.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
15 years agoPermit both 32 and 64-bit builds
Mathieu Desnoyers [Fri, 18 Sep 2009 12:59:21 +0000 (08:59 -0400)] 
Permit both 32 and 64-bit builds

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
15 years agoDefault to architecture size, add Makefile32
Mathieu Desnoyers [Fri, 18 Sep 2009 12:47:55 +0000 (08:47 -0400)] 
Default to architecture size, add Makefile32

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
15 years agoUpdate makefile to compiler for 32-bit architectures on x86_64
Mathieu Desnoyers [Fri, 18 Sep 2009 12:46:24 +0000 (08:46 -0400)] 
Update makefile to compiler for 32-bit architectures on x86_64

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
15 years agoRename define
Mathieu Desnoyers [Fri, 18 Sep 2009 12:32:23 +0000 (08:32 -0400)] 
Rename define

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
15 years agoFix urcu.c comment
Mathieu Desnoyers [Fri, 18 Sep 2009 12:30:03 +0000 (08:30 -0400)] 
Fix urcu.c comment

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
15 years agoqsbr: use defines to clarify code.
Mathieu Desnoyers [Fri, 18 Sep 2009 12:20:22 +0000 (08:20 -0400)] 
qsbr: use defines to clarify code.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
15 years agoqsbr: portability fixes: use unsigned long for the gp counters.
Mathieu Desnoyers [Thu, 17 Sep 2009 15:11:42 +0000 (11:11 -0400)] 
qsbr: portability fixes: use unsigned long for the gp counters.

unsigned wraps properly in C (modulo ULONG_MAX + 1), IOW ULONG_MAX + 2
_is_ defined and is 1.

Rewrite rcu_gp_ongoing test to work in the unsigned case:

    a - b < 0

becomes

    a - b > ULONG_MAX / 2

This test actually means a - b > 0x7f....f which is exactly what we want
to test for in the first place, but in a portable way.

Signed-off-by: Pierre Habouzit <madcoder@debian.org>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
15 years agoqsbr: micro optimization of the gp use.
Mathieu Desnoyers [Thu, 17 Sep 2009 12:38:06 +0000 (08:38 -0400)] 
qsbr: micro optimization of the gp use.

Follow-up on 1a80f3: since now `0' for a gp counter means "offline", just
be sure that the global GP counter is never zero. To achieve that, let its
first value ever be one, and increment it 2 by 2 like previously done.
Note that it internaly uses the fact that signed integers wraps (which the
previous code already assumed anyways) but this is undefined behaviour in
C. Using unsigned longs would probably be more portable.

This way, setting the cpu online, marking a quiescent state is just a
matter of copying the global gp counter instead of incrementing it by one.

This saves one CPU instruction, and supposedly even register use for
architectures providing memory to memory copy operands.

Signed-off-by: Pierre Habouzit <madcoder@debian.org>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
15 years agoqsbr: save two full smp_mb() when the writer is also a reader.
Pierre Habouzit [Thu, 17 Sep 2009 12:30:19 +0000 (08:30 -0400)] 
qsbr: save two full smp_mb() when the writer is also a reader.

Now that you've put the barriers before taking lock, and after releasing
it, one can expand the _rcu_thread_{on,off}line call, and optimize two
barrier calls away. (this is patch 1/2).

Signed-off-by: Pierre Habouzit <madcoder@debian.org>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
15 years agorename QSBR force_mb_all_threads to smp_mb
Mathieu Desnoyers [Wed, 16 Sep 2009 16:58:58 +0000 (12:58 -0400)] 
rename QSBR force_mb_all_threads to smp_mb

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
15 years agoMove mb() outside of the synchronize C.S.
Mathieu Desnoyers [Wed, 16 Sep 2009 16:44:27 +0000 (12:44 -0400)] 
Move mb() outside of the synchronize C.S.

Will be useful for future Q.S. merging. Does not change the RCU g.p. guarantee.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
15 years agoEnsure LOAD_SHARED/STORE_SHARED semantic is used in QSBR RCU
Mathieu Desnoyers [Wed, 16 Sep 2009 16:40:27 +0000 (12:40 -0400)] 
Ensure LOAD_SHARED/STORE_SHARED semantic is used in QSBR RCU

Ensures all volatile accesses are indeed volatile.
On architectures without coherent caches, will perform the proper cache flushes
when needed.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
15 years agoQSBR offline thread micro-optimization
Mathieu Desnoyers [Wed, 16 Sep 2009 13:39:20 +0000 (09:39 -0400)] 
QSBR offline thread micro-optimization

> That's an interesting paper for sure. I had one micro-optimization in
> mind when I read the paper for QSBR, you can decide that making a CPU
> offline can be done by writing 0 to the per thread counter, instead of
> reading the global counter. It saves a load from a shared variable,
> which probably helps in its tiny way.
>

In wait_for_quiescent_state, the test for Q.S. is :

                while (rcu_gp_ongoing(index->rcu_reader_qs_gp) &&
                       (*index->rcu_reader_qs_gp - urcu_gp_ctr < 0))
                        cpu_relax();

where :

static inline int rcu_gp_ongoing(long *value)
{
        if (value == NULL)
                return 0;

        return LOAD_SHARED(*value) & 1;
}

Your proposal would work for the rcu_gp_ongoing test, as it only checks
for the parity. Given this test is enough to guarantee that we skip the
reader thread, then yes, it seems to work just fine.

Proposed-by: Pierre Habouzit <madcoder@debian.org>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
15 years agoExpose nop QSBR read lock to non-GPL/LGPL programs
Mathieu Desnoyers [Wed, 16 Sep 2009 13:30:22 +0000 (09:30 -0400)] 
Expose nop QSBR read lock to non-GPL/LGPL programs

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
15 years agoUpdate README (again)
Mathieu Desnoyers [Tue, 15 Sep 2009 23:46:07 +0000 (19:46 -0400)] 
Update README (again)

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
15 years agoupdate README
Mathieu Desnoyers [Tue, 15 Sep 2009 23:40:56 +0000 (19:40 -0400)] 
update README

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
15 years agoRename CONFIG_URCU_AVOID_SIGNALS to URCU_MB, and README updates
Mathieu Desnoyers [Tue, 15 Sep 2009 23:38:36 +0000 (19:38 -0400)] 
Rename CONFIG_URCU_AVOID_SIGNALS to URCU_MB, and README updates

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
15 years agoRevert "qsbr urcu: make it safe to call rcu_sychronize from a registered thread."
Mathieu Desnoyers [Tue, 15 Sep 2009 22:09:36 +0000 (18:09 -0400)] 
Revert "qsbr urcu: make it safe to call rcu_sychronize from a registered thread."

This reverts commit d1238495fdaf1c85447690231bf5d1838b83bf88.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
15 years agoqsbr urcu: make it safe to call rcu_sychronize from a registered thread
Mathieu Desnoyers [Tue, 15 Sep 2009 20:39:35 +0000 (16:39 -0400)] 
qsbr urcu: make it safe to call rcu_sychronize from a registered thread

Actually, the proper way to deal with threads registered as readers but also
calling synchronize_rcu() is to mark them as offline while the synchronize is in
progress.

Else, since calling rcu_sychronize will increment urcu_gp_ctr, we will be
stupidly waiting for ourselves and deadlock.

Original-patch-from: Pierre Habouzit <madcoder@debian.org>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
15 years agoqsbr urcu: make it safe to call rcu_sychronize from a registered thread.
Pierre Habouzit [Tue, 15 Sep 2009 20:17:22 +0000 (16:17 -0400)] 
qsbr urcu: make it safe to call rcu_sychronize from a registered thread.

Else, since calling rcu_sychronize will increment urcu_gp_ctr, we will be
stupidly waiting for ourselves and deadlock.

No need to use _rcu_quiescent_state() since we are currently owning the
internal URCU lock, so the memory barriers and ACCESS_ONCE() are overkill.

Signed-off-by: Pierre Habouzit <madcoder@debian.org>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
15 years agoqsbr urcu: simplifications and fixes.
Pierre Habouzit [Tue, 15 Sep 2009 20:15:27 +0000 (16:15 -0400)] 
qsbr urcu: simplifications and fixes.

need_mb is unused in qsbr, get rid of it.
add missing static's

Signed-off-by: Pierre Habouzit <madcoder@debian.org>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
15 years agoBuild urcu-qsbr.so library, update README
Mathieu Desnoyers [Tue, 15 Sep 2009 19:51:34 +0000 (15:51 -0400)] 
Build urcu-qsbr.so library, update README

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
15 years agourcu qsbr: add DEBUG_RCU self check
Mathieu Desnoyers [Tue, 15 Sep 2009 18:36:55 +0000 (14:36 -0400)] 
urcu qsbr: add DEBUG_RCU self check

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
15 years agoupdate README
Mathieu Desnoyers [Tue, 15 Sep 2009 18:24:34 +0000 (14:24 -0400)] 
update README

- Add comment about new threads and signals
- document DEBUG_RCU

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
15 years agourcu qsbr: move thread online after add reader
Mathieu Desnoyers [Tue, 15 Sep 2009 18:13:09 +0000 (14:13 -0400)] 
urcu qsbr: move thread online after add reader

For a matter of symmetry with the unregister, make thread online only after it
has been added as reader.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
15 years agoqsbr rcu: rc_register_thread also make the thread online.
Pierre Habouzit [Tue, 15 Sep 2009 18:09:59 +0000 (14:09 -0400)] 
qsbr rcu: rc_register_thread also make the thread online.

Else, all its RCU reader critical sections aren't safe until its first
_rcu_quiescent_state() call.

Signed-off-by: Pierre Habouzit <madcoder@debian.org>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
15 years agoupdate rcu_dereference comment
Mathieu Desnoyers [Sat, 5 Sep 2009 23:52:26 +0000 (19:52 -0400)] 
update rcu_dereference comment

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
15 years agoDocument access ordering of rcu_dereference wrt VSS
Mathieu Desnoyers [Sat, 5 Sep 2009 16:35:46 +0000 (12:35 -0400)] 
Document access ordering of rcu_dereference wrt VSS

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
15 years agoadd global include Makefile
Mathieu Desnoyers [Sun, 30 Aug 2009 14:50:36 +0000 (10:50 -0400)] 
add global include Makefile

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
15 years agoMove test programs to tests/ subdir
Mathieu Desnoyers [Sun, 30 Aug 2009 14:50:04 +0000 (10:50 -0400)] 
Move test programs to tests/ subdir

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
15 years agourcu.c: declare noop urcu_init() function non-static
Pierre-Marc Fournier [Tue, 21 Jul 2009 22:09:47 +0000 (18:09 -0400)] 
urcu.c: declare noop urcu_init() function non-static

The RCU library is sometimes used in constructor context. In these cases,
because it is impossible to predict whether the liburcu constructor has already
been called, an explicit call to the urcu_init function must be made.
Declaring the noop version of the urcu_init() function as static breaks code
that calls urcu_init() explicitly when CONFIG_AVOID_SIGNALS is true. To prevent
this, this patch makes the declaration non-static.

From: Pierre-Marc Fournier <pierre-marc.fournier@polymtl.ca>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
15 years agoMove DEBUG_FULL_MB to properly named CONFIG_URCU_AVOID_SIGNALS
Mathieu Desnoyers [Wed, 8 Jul 2009 04:13:13 +0000 (00:13 -0400)] 
Move DEBUG_FULL_MB to properly named CONFIG_URCU_AVOID_SIGNALS

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
15 years agoAdd SA_RESTART flag to signal handler
Pierre-Marc Fournier [Tue, 7 Jul 2009 22:14:19 +0000 (18:14 -0400)] 
Add SA_RESTART flag to signal handler

With this flag, the kernel restarts automatically some system calls
that were interrupted by the signal. Without this flag, these system
calls would fail with errno = EINTR.

Even with this flag, the kernel cannot restart some system calls, and
developers should verify whether these system calls failed with EINTR
and restart them manually in that case. For the list of system calls
that cannot be restarted automatically, see signal(7).

Because of this, we cannot completely eliminate the side-effects of
liburcu on the application, but I think we should try our best and
set SA_RESTART.

From: Pierre-Marc Fournier <pierre-marc.fournier@polymtl.ca>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
15 years agoupdate license
Mathieu Desnoyers [Mon, 29 Jun 2009 14:59:00 +0000 (10:59 -0400)] 
update license

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
15 years agoUpdate license files and readme
Mathieu Desnoyers [Mon, 29 Jun 2009 14:57:19 +0000 (10:57 -0400)] 
Update license files and readme

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
15 years agoRe-license arch_atomic_s390.h and arch_s390.h
Jan Blunck [Mon, 29 Jun 2009 09:46:43 +0000 (11:46 +0200)] 
Re-license arch_atomic_s390.h and arch_s390.h

Mathieu Desnoyers asked for re-license the low-level architecture specific
bits under MIT style license.

Signed-off-by: Jan Blunck <jblunck@suse.de>
15 years agos390: Fix some compiler warnings
Jan Blunck [Wed, 17 Jun 2009 11:49:44 +0000 (13:49 +0200)] 
s390: Fix some compiler warnings

Fix warning about _atomic_exchange being defined but unused and explicitly
cast the 2nd argument.

Signed-off-by: Jan Blunck <jblunck@suse.de>
15 years agoAdd S390 support
Jan Blunck [Wed, 17 Jun 2009 11:40:38 +0000 (13:40 +0200)] 
Add S390 support

This patch adds support for the S390 architecture.

Signed-off-by: Jan Blunck <jblunck@suse.de>
15 years agoURCU's api_*.h
Paul E. McKenney [Tue, 16 Jun 2009 18:26:36 +0000 (11:26 -0700)] 
URCU's api_*.h

On Tue, Jun 16, 2009 at 07:09:11PM +0200, Jan Blunck wrote:
> I already did most of that for libkcompat. That was actually why I was
> asking if I should port that over.

Nevertheless, I offer the following patch to userspace-rcu to provide
a gcc-library version of the api_*.h files and to clean up the build a
bit.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
15 years agoapi.h is only needed by urcutorture
Jan Blunck [Tue, 16 Jun 2009 09:22:13 +0000 (11:22 +0200)] 
api.h is only needed by urcutorture

Signed-off-by: Jan Blunck <jblunck@suse.de>
15 years agoAdd S390 architecture specific headers
Jan Blunck [Tue, 16 Jun 2009 09:20:55 +0000 (11:20 +0200)] 
Add S390 architecture specific headers

This implements atomic exchange and some other trivial operations like
barriers for the S390 architecture. All of this is based on the
"z/Architecture Principles of Operation" as released by IBM.

Note that api_s390.h is missing so urcutortures applications don't build.

Signed-off-by: Jan Blunck <jblunck@suse.de>
15 years agoAdd runpaul-phase6.sh
Mathieu Desnoyers [Fri, 26 Jun 2009 15:18:07 +0000 (11:18 -0400)] 
Add runpaul-phase6.sh

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
15 years agoFix phase5 test log collection
Mathieu Desnoyers [Fri, 26 Jun 2009 15:17:18 +0000 (11:17 -0400)] 
Fix phase5 test log collection

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
15 years agoAdd local reclaim tests
Mathieu Desnoyers [Tue, 23 Jun 2009 15:25:28 +0000 (11:25 -0400)] 
Add local reclaim tests

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
15 years agoUpdate phase3 batch size
Mathieu Desnoyers [Mon, 22 Jun 2009 18:35:58 +0000 (14:35 -0400)] 
Update phase3 batch size

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
15 years agoAdd phase 5 test, educated guess for batch size 32768
Mathieu Desnoyers [Mon, 22 Jun 2009 18:33:59 +0000 (14:33 -0400)] 
Add phase 5 test, educated guess for batch size 32768

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
15 years agoUpdate default batch size to 32768, after removal of mutex
Mathieu Desnoyers [Mon, 22 Jun 2009 14:55:39 +0000 (10:55 -0400)] 
Update default batch size to 32768, after removal of mutex

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
15 years agoRemote mutex from RCU write-side
Mathieu Desnoyers [Mon, 22 Jun 2009 14:50:53 +0000 (10:50 -0400)] 
Remote mutex from RCU write-side

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
15 years agoProtect shared affinity table with mutex
Mathieu Desnoyers [Mon, 22 Jun 2009 01:33:38 +0000 (21:33 -0400)] 
Protect shared affinity table with mutex

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