Re: [mm][RFC][PATCH 0/11] mm accessor updates.

From: Peter Zijlstra
Date: Thu Dec 17 2009 - 10:03:32 EST


On Thu, 2009-12-17 at 06:45 -0800, Paul E. McKenney wrote:
> On Thu, Dec 17, 2009 at 09:54:30AM +0100, Andi Kleen wrote:
> > On Thu, Dec 17, 2009 at 09:45:34AM +0100, Peter Zijlstra wrote:
> > > On Thu, 2009-12-17 at 09:40 +0100, Andi Kleen wrote:
> > > > On Wed, Dec 16, 2009 at 11:57:04PM +0100, Peter Zijlstra wrote:
> > > > > On Wed, 2009-12-16 at 19:31 +0900, KAMEZAWA Hiroyuki wrote:
> > > > >
> > > > > > The problem of range locking is more than mmap_sem, anyway. I don't think
> > > > > > it's possible easily.
> > > > >
> > > > > We already have a natural range lock in the form of the split pte lock.
> > > > >
> > > > > If we make the vma lookup speculative using RCU, we can use the pte lock
> > > >
> > > > One problem is here that mmap_sem currently contains sleeps
> > > > and RCU doesn't work for blocking operations until a custom
> > > > quiescent period is defined.
> > >
> > > Right, so one thing we could do is always have preemptible rcu present
> > > in another RCU flavour, like
> > >
> > > rcu_read_lock_sleep()
> > > rcu_read_unlock_sleep()
> > > call_rcu_sleep()
> > >
> > > or whatever name that would be, and have PREEMPT_RCU=y only flip the
> > > regular rcu implementation between the sched/sleep one.
> >
> > That could work yes.
>
> OK, I have to ask...
>
> Why not just use the already-existing SRCU in this case?

Because somehow the preemptible RCU implementation seems superior to
SRCU, but sure, when developing all this one can start by simply
mandating PREEMPT_RCU=y, then maybe use SRCU or try to drop the rcu lock
when sleeping.

That mmap_sem lockbreak on wait_page() seems like a sensible idea
anyway, regardless of what we do with the rest of the locking.



--
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/