On 5/20/25 6:31 PM, Luiz Augusto von Dentz wrote:
I'm afraid you were not looking into other places of the code regarding this, what you should have done is: list_del_rcu synchronize_rcu free synchronize_rcu will wait the threads holding rcu_read_lock so by the time it returns we can proceed to free because all existing readers should be done already and if in the meantime another thread attempts to iterate in the list that shall already been update given that list_del_rcu has updated the list.
Got your point. OTOH 'mgmt_pending' may be currently altered by both mgmt_pending_add() and mgmt_pending_remove(), and they may be called from the different threads at the same time. If so, there are two concurrent writers, and the whole thing requires an extra synchronization beyond the one provided by RCU primitives. Am I missing something? Dmitry