Re: [RFC PATCH] asynchronous page fault.
From: KAMEZAWA Hiroyuki
Date: Sun Dec 27 2009 - 22:16:55 EST
On Mon, 28 Dec 2009 08:28:39 +0530
Balbir Singh <balbir@xxxxxxxxxxxxxxxxxx> wrote:
> * KAMEZAWA Hiroyuki <kamezawa.hiroyu@xxxxxxxxxxxxxx> [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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/