From: Mathieu Desnoyers Date: Fri, 10 Jun 2016 18:43:40 +0000 (-0400) Subject: rculfhash: Documentation: clarify need for grace period before "re-using" X-Git-Tag: v0.10.0~42 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=5002434419b458f1de889b3ed1110b440d3bf5b0;p=userspace-rcu.git rculfhash: Documentation: clarify need for grace period before "re-using" Grace period must be waited for in case a node removed from the hash table is re-used, similarly to the reclaim use-case. Reported-by: Luke K D'Alessandro Signed-off-by: Mathieu Desnoyers --- diff --git a/urcu/rculfhash.h b/urcu/rculfhash.h index d8c85bc..9934422 100644 --- a/urcu/rculfhash.h +++ b/urcu/rculfhash.h @@ -298,7 +298,7 @@ void cds_lfht_add(struct cds_lfht *ht, unsigned long hash, * Return the unique node already present upon failure. If * cds_lfht_add_unique fails, the node passed as parameter should be * freed by the caller. In this case, the caller does NOT need to wait - * for a grace period before freeing the node. + * for a grace period before freeing or re-using the node. * Call with rcu_read_lock held. * Threads calling this API need to be registered RCU read-side threads. * @@ -334,7 +334,7 @@ struct cds_lfht_node *cds_lfht_add_unique(struct cds_lfht *ht, * Call with rcu_read_lock held. * Threads calling this API need to be registered RCU read-side threads. * After successful replacement, a grace period must be waited for before - * freeing the memory reserved for the returned node. + * freeing or re-using the memory reserved for the returned node. * * The semantic of replacement vs lookups and traversals is the * following: if lookups and traversals are performed between a key @@ -376,8 +376,8 @@ struct cds_lfht_node *cds_lfht_add_replace(struct cds_lfht *ht, * Call with rcu_read_lock held. * Threads calling this API need to be registered RCU read-side threads. * After successful replacement, a grace period must be waited for before - * freeing the memory reserved for the old node (which can be accessed - * with cds_lfht_iter_get_node). + * freeing or re-using the memory reserved for the old node (which can + * be accessed with cds_lfht_iter_get_node). * * The semantic of replacement vs lookups is the same as * cds_lfht_add_replace(). @@ -409,8 +409,8 @@ int cds_lfht_replace(struct cds_lfht *ht, * Call with rcu_read_lock held. * Threads calling this API need to be registered RCU read-side threads. * After successful removal, a grace period must be waited for before - * freeing the memory reserved for old node (which can be accessed with - * cds_lfht_iter_get_node). + * freeing or re-using the memory reserved for old node (which can be + * accessed with cds_lfht_iter_get_node). * Upon success, this function issues a full memory barrier before and * after its atomic commit. Upon failure, this function does not issue * any memory barrier.