Re: [RFC][PATCH 4/6] SRCU free VMAs

2014-10-24 Thread Christoph Lameter
On Fri, 24 Oct 2014, Peter Zijlstra wrote: > The hold time isn't relevant, in fact breaking up the mmap_sem such that > we require multiple acquisitions will just increase the cacheline > bouncing. Well this wont be happening anymore once you RCUify the stuff. If you go to sleep then its best to

Re: [RFC][PATCH 4/6] SRCU free VMAs

2014-10-24 Thread Peter Zijlstra
On Fri, Oct 24, 2014 at 10:16:24AM -0500, Christoph Lameter wrote: > Hmmm... One optimization to do before we get into these changes is to work > on allowing the dropping of mmap_sem before we get to sleeping and I/O and > then reevaluate when I/O etc is complete? This is probably the longest > ho

Re: [RFC][PATCH 4/6] SRCU free VMAs

2014-10-24 Thread Christoph Lameter
On Tue, 21 Oct 2014, Peter Zijlstra wrote: > On Mon, Oct 20, 2014 at 04:41:45PM -0700, Linus Torvalds wrote: > > On Mon, Oct 20, 2014 at 2:56 PM, Peter Zijlstra > > wrote: > > > Manage the VMAs with SRCU such that we can do a lockless VMA lookup. > > > > Can you explain why srcu, and not plain r

Re: [RFC][PATCH 4/6] SRCU free VMAs

2014-10-24 Thread Peter Zijlstra
On Fri, Oct 24, 2014 at 11:33:58AM +0800, Lai Jiangshan wrote: > On 10/23/2014 07:03 PM, Peter Zijlstra wrote: > > On Thu, Oct 23, 2014 at 06:14:45PM +0800, Lai Jiangshan wrote: > >> > >>> > >>> +struct vm_area_struct *find_vma_srcu(struct mm_struct *mm, unsigned long > >>> addr) > >>> +{ > >>>

Re: [RFC][PATCH 4/6] SRCU free VMAs

2014-10-23 Thread Lai Jiangshan
On 10/23/2014 07:03 PM, Peter Zijlstra wrote: > On Thu, Oct 23, 2014 at 06:14:45PM +0800, Lai Jiangshan wrote: >> >>> >>> +struct vm_area_struct *find_vma_srcu(struct mm_struct *mm, unsigned long >>> addr) >>> +{ >>> + struct vm_area_struct *vma; >>> + unsigned int seq; >>> + >>> + WARN_ON

Re: [RFC][PATCH 4/6] SRCU free VMAs

2014-10-23 Thread Peter Zijlstra
On Thu, Oct 23, 2014 at 06:14:45PM +0800, Lai Jiangshan wrote: > > > > > +struct vm_area_struct *find_vma_srcu(struct mm_struct *mm, unsigned long > > addr) > > +{ > > + struct vm_area_struct *vma; > > + unsigned int seq; > > + > > + WARN_ON_ONCE(!srcu_read_lock_held(&vma_srcu)); > > + >

Re: [RFC][PATCH 4/6] SRCU free VMAs

2014-10-23 Thread Lai Jiangshan
> > +struct vm_area_struct *find_vma_srcu(struct mm_struct *mm, unsigned long > addr) > +{ > + struct vm_area_struct *vma; > + unsigned int seq; > + > + WARN_ON_ONCE(!srcu_read_lock_held(&vma_srcu)); > + > + do { > + seq = read_seqbegin(&mm->mm_seq); > +

Re: [RFC][PATCH 4/6] SRCU free VMAs

2014-10-21 Thread Peter Zijlstra
On Mon, Oct 20, 2014 at 04:41:45PM -0700, Linus Torvalds wrote: > On Mon, Oct 20, 2014 at 2:56 PM, Peter Zijlstra wrote: > > Manage the VMAs with SRCU such that we can do a lockless VMA lookup. > > Can you explain why srcu, and not plain regular rcu? > > Especially as you then *note* some of the

Re: [RFC][PATCH 4/6] SRCU free VMAs

2014-10-21 Thread Peter Zijlstra
On Mon, Oct 20, 2014 at 04:41:45PM -0700, Linus Torvalds wrote: > On Mon, Oct 20, 2014 at 2:56 PM, Peter Zijlstra wrote: > > Manage the VMAs with SRCU such that we can do a lockless VMA lookup. > > Can you explain why srcu, and not plain regular rcu? > > Especially as you then *note* some of the

Re: [RFC][PATCH 4/6] SRCU free VMAs

2014-10-20 Thread Linus Torvalds
On Mon, Oct 20, 2014 at 2:56 PM, Peter Zijlstra wrote: > Manage the VMAs with SRCU such that we can do a lockless VMA lookup. Can you explain why srcu, and not plain regular rcu? Especially as you then *note* some of the problems srcu can have. Making it regular rcu would also seem to make it po

[RFC][PATCH 4/6] SRCU free VMAs

2014-10-20 Thread Peter Zijlstra
Manage the VMAs with SRCU such that we can do a lockless VMA lookup. We put the fput(vma->vm_file) in the SRCU callback, this keeps files valid during speculative faults, this is possible due to the delayed fput work by Al Viro -- do we need srcu_barrier() in unmount someplace? We guard the mm_rb