Regarding the second point, I'm sorry, my fingers typed rcu_dereference() whereas my brain wasthinking to rcu_assign_pointer(). rcu_dereference() could be used in update-side code, as youpointed out, but obviously not in __list_add_rcu().Therefore __list_add_rcu() could be: new->next = next; new->prev = prev; rcu_assign_pointer(prev->next, new); next->prev = new;The main advantage of this is readability IMHO.You said that __list_add_rcu() must be protected by appropriate locking, and a memory barrieris implied by lock acquisition which should be enough. But __list_add_rcu() has a memorybarrier in its implementation.Thanks.
Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds