From: Mathieu Desnoyers Date: Sun, 12 Aug 2012 18:38:52 +0000 (-0400) Subject: rcuja: add data structures for rcu_ja and shadow nodes X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=511b4dcca9e6b2ed4c71f3e19a60c4db8e4ba064;p=urcu.git rcuja: add data structures for rcu_ja and shadow nodes Signed-off-by: Mathieu Desnoyers --- diff --git a/rcuja/rcuja-internal.h b/rcuja/rcuja-internal.h index 604cb8e..c030451 100644 --- a/rcuja/rcuja-internal.h +++ b/rcuja/rcuja-internal.h @@ -23,5 +23,28 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include +#include + +/* Never declared. Opaque type used to store flagged node pointers. */ +struct rcu_ja_node_flag; + +/* + * Shadow node contains mutex and call_rcu head associated with a node. + */ +struct rcu_ja_shadow_node { + pthread_mutex_t lock; /* mutual exclusion on node */ + struct rcu_head head; /* for deferred node and shadow node reclaim */ +}; + +struct rcu_ja { + struct rcu_ja_node_flag *root; + /* + * We use a hash table to associate nodes to their respective + * shadow node. This helps reducing lookup hot path cache + * footprint, especially for very small nodes. + */ + struct cds_lfht *ht; +}; #endif /* _URCU_RCUJA_INTERNAL_H */ diff --git a/rcuja/rcuja.c b/rcuja/rcuja.c index b164b96..6d815e2 100644 --- a/rcuja/rcuja.c +++ b/rcuja/rcuja.c @@ -183,9 +183,6 @@ void static_array_size_check(void) CAA_BUILD_BUG_ON(CAA_ARRAY_SIZE(ja_types) > JA_TYPE_MAX_NR); } -/* Never declared. Opaque type used to store flagged node pointers. */ -struct rcu_ja_node_flag; - /* * The rcu_ja_node contains the compressed node data needed for * read-side. For linear and pool node configurations, it starts with a