in cds_list_add_rcu, use rcu_assign_pointer to update head->next
atomically and provide the memory barrier before publishing head->next.
Notice that we don't need the wmb() prior to store to prev, because RCU
traversals only go forward, and thus only use "next".
in cds_list_del_rcu, use CMM_STORE_SHARED() to store to elem->prev->next
atomically.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
{
newp->next = head->next;
newp->prev = head;
- cmm_smp_wmb();
head->next->prev = newp;
- head->next = newp;
+ rcu_assign_pointer(head->next, newp);
}
/* Add new element at the tail of the list. */
void cds_list_del_rcu(struct cds_list_head *elem)
{
elem->next->prev = elem->prev;
- elem->prev->next = elem->next;
+ CMM_STORE_SHARED(elem->prev->next, elem->next);
}
/*