[ovs-git] Open vSwitch: lib/ovs-rcu: Rename ovsrcu_init() as ovsrcu_set_hidden(). (master)

dev at openvswitch.org dev at openvswitch.org
Tue Jun 3 16:04:13 UTC 2014


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Open vSwitch".

The branch, master has been updated
       via  7e5f06c31f34c7472e5c6a304a4ea56caf6cea82 (commit)
       via  328fa0dc4552643e05e4ab4e4df4e18b8fc0b12d (commit)
       via  61edaebbd5985dca8c0325a5b273671b9ea9cd60 (commit)
      from  07383e165e7e7ec2d94ea9066568dcda1a400d08 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 7e5f06c31f34c7472e5c6a304a4ea56caf6cea82
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=7e5f06c31f34c7472e5c6a304a4ea56caf6cea82
Author: Jarno Rajahalme <jrajahalme at nicira.com>
		
lib/ovs-rcu: Rename ovsrcu_init() as ovsrcu_set_hidden().
		
ovsrcu_init() was named after the atomic_init(), but the semantics are
different enough to warrant a different name.  Basically C11
atomic_init is defined in a way that allows the implementation to
assign the value without any syncronization, so in theory stores via
atomic_init could be seen by others after stores via atomic_set, even
if the atomic_init appeared earlier in the code.

ovsrcu_set_hidden() can be used to set an RCU protected variable when
it is not yet accessible by any active reader, but will be made
visible later via an ovsrcu_set call on some other pointer.

This patch also adds a new ovsrcu_init() that can be used to initilize
RCU protected variables when the readers are not yet executing.  The
new ovsrcu_init() is implemented with atomic_init(), so it does not
provide any kind of syncronization.

Signed-off-by: Jarno Rajahalme <jrajahalme at nicira.com>
Acked-by: YAMAMOTO Takashi <yamamoto at valinux.co.jp>

commit 328fa0dc4552643e05e4ab4e4df4e18b8fc0b12d
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=328fa0dc4552643e05e4ab4e4df4e18b8fc0b12d
Author: Jarno Rajahalme <jrajahalme at nicira.com>
		
lib/ovs-rcu: Evaluate parameters before ovsrcu_set and ovsrcu_init.
		
ovsrcu_set() and ovsrcu_init() look like functions, so users are
justified in expecting the arguments to be evaluated before any of
the body of ovsrcu_set or ovsrcu_init().

With ovs-atomic-pthreads, a fallback ovs-atomics implementation used
when no C11 atomics are available or with GCC older than 4.0, the
prior definitions led to nested mutex locking when the 'VALUE'
argument was an atomic_read().  This is resolved by ensuring function
argument semantics for the parameters.  For non-GCC compilers this is
done with an inline function.  GCC implementation of ovs-rcu does not
fix the RCU variable type, so a GCC macro needs to be used instead.

Reported-by: YAMAMOTO Takashi <yamamoto at valinux.co.jp>
Signed-off-by: Jarno Rajahalme <jrajahalme at nicira.com>
Acked-by: YAMAMOTO Takashi <yamamoto at valinux.co.jp>

commit 61edaebbd5985dca8c0325a5b273671b9ea9cd60
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=61edaebbd5985dca8c0325a5b273671b9ea9cd60
Author: Jarno Rajahalme <jrajahalme at nicira.com>
		
ovs-rcu: Remove the extra 'typedef' keyword.
		
'struct ovsrcu_pointer' is always used with the 'struct' keyword, so
remove the unneeded 'typedef'.

Signed-off-by: Jarno Rajahalme <jrajahalme at nicira.com>
Acked-by: YAMAMOTO Takashi <yamamoto at valinux.co.jp>

-----------------------------------------------------------------------

Summary of changes:
 lib/cmap.c    |    6 +++---
 lib/ovs-rcu.h |   47 +++++++++++++++++++++++++++++++++++++----------
 2 files changed, 40 insertions(+), 13 deletions(-)


hooks/post-receive
-- 
Open vSwitch



More information about the git mailing list