On Sunday 09 September 2012 18:10, Roland Dreier wrote: > > Please look at commit 7cf9c2c76c1a ("[PATCH] radix-tree: RCU lockless > readside") > Roland,
What about the following note (from the commit diff mentioned above): +/** + * Radix-tree synchronization + * + * The radix-tree API requires that users provide all synchronisation (with + * specific exceptions, noted below). + * + * Synchronization of access to the data items being stored in the tree, and + * management of their lifetimes must be completely managed by API users. + * + * For API usage, in general, + * - any function _modifying_ the the tree or tags (inserting or deleting + * items, setting or clearing tags must exclude other modifications, and + * exclude any functions reading the tree. + * - any function _reading_ the the tree or tags (looking up items or tags, + * gang lookups) must exclude modifications to the tree, but may occur + * concurrently with other readers. + * + * The notable exceptions to this rule are the following functions: + * radix_tree_lookup + * radix_tree_tag_get + * radix_tree_gang_lookup + * radix_tree_gang_lookup_tag + * radix_tree_tagged + * ======= JPM -- Note the following text! ========================= + * The first 4 functions are able to be called locklessly, using RCU. The + * caller must ensure calls to these functions are made within rcu_read_lock() + * regions. =========================================== + * Other readers (lock-free or otherwise) and modifications may be + * running concurrently. Roland, the above states explicitly that radix_tree_lookup should be called only under rcu_read_lock()! This is NOT the case in our driver, in mlx4_eq_int()/mlx4_cq_completion() . Looks to me, then, that the spinlock in mlx4_cq_completion() is required. - Jack -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html