Movatterモバイル変換


[0]ホーム

URL:


LWN.net LogoLWN
.net
News from the source
LWN
|
|
Log in /Subscribe /Register

Some usages of RCU in the kernel code

Some usages of RCU in the kernel code

Posted Jan 7, 2008 10:14 UTC (Mon) byfbh (guest, #49754)
In reply to: Some usages of RCU in the kernel code by PaulMcKenney
Parent article:What is RCU, Fundamentally?

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.


to post comments

Some usages of RCU in the kernel code

Posted Jan 7, 2008 15:28 UTC (Mon) byPaulMcKenney (✭ supporter ✭, #9624) [Link] (2 responses)

Good point!  Would you like to submit a patch?

Some usages of RCU in the kernel code

Posted Jan 7, 2008 16:03 UTC (Mon) byfbh (guest, #49754) [Link] (1 responses)

Well, I actually raised 2 points and I'm not sure which one is the good one...Could you please clarify ?To answer your question, I don't have any problems for submitting a patch.---PS: This interface is pretty hard for discussing on an article. It's like bottom-postingexcept we loose all its advantages... Just my 2 cents.

Some usages of RCU in the kernel code

Posted Jan 7, 2008 16:52 UTC (Mon) byPaulMcKenney (✭ supporter ✭, #9624) [Link]

I was inviting a patch for incorporating the smp_wmb() into the rcu_assign_pointer.The lock acquisition makes rcu_dereference() unnecessary, but cannot enforce the orderingprovided by the smp_wmb()/rcu_assign_pointer().


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds


[8]ページ先頭

©2009-2026 Movatter.jp