Messages in this thread | | | Date | Mon, 28 Dec 2009 12:13:18 +0900 | From | KAMEZAWA Hiroyuki <> | Subject | Re: [RFC PATCH] asynchronous page fault. |
| |
On Mon, 28 Dec 2009 08:28:39 +0530 Balbir Singh <balbir@linux.vnet.ibm.com> wrote:
> * KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> [2009-12-28 10:05:14]:
> > - rb-tree's rb_left and rb_right don't points to memory other than > > rb-tree. (or NULL) And vmas are not freed/reused while rcu_read_lock(). > > Then, we don't dive into unknown memory. > > - Then, we can skip rcu_assign_pointer(). > > > > We can, but the data being on read-side is going to be out-of-date > more than without the use of rcu_assign_pointer(). Do we need variants > like to rcu_rb_next() to avoid overheads for everyone? > I myself can't know how often out-of-date data can be seen (because I use x86).
But, I feel that we don't see broken tree so often. Because... - Single-threaded apps never see broken tree. - Even if rb-tree modification frequently happens, tree rotation is not very often and sub-trees tend to be stable as a chunk.
Hmm, adding barrier like this ?
static inline void __vma_unlink(struct mm_struct *mm, struct vm_area_struct *vma, struct vm_area_struct *prev) { prev->vm_next = vma->vm_next; rb_erase(&vma->vm_rb, &mm->mm_rb); if (mm->mmap_cache == vma) mm->mmap_cache = prev; smp_wb(); <==============================================(new) }
Regards, -Kame
| |