linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Nick Piggin <npiggin@suse.de>
To: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: linux-mm@kvack.org, Christoph Lameter <clameter@engr.sgi.com>,
	"Paul E. McKenney" <paulmck@us.ibm.com>,
	Ingo Molnar <mingo@elte.hu>
Subject: Re: [RFC][PATCH 3/5] mm: RCUify vma lookup
Date: Tue, 6 Mar 2007 09:36:32 +0100	[thread overview]
Message-ID: <20070306083632.GA10540@wotan.suse.de> (raw)
In-Reply-To: <20070306022319.GF23845@wotan.suse.de>

On Tue, Mar 06, 2007 at 03:23:19AM +0100, Nick Piggin wrote:
> On Tue, Mar 06, 2007 at 02:38:18AM +0100, Peter Zijlstra wrote:
> > mostly lockless vma lookup using the new b+tree
> > pin the vma using an atomic refcount
> > 
> > Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
> > ---
> >  
> > +static void lock_vma(struct vm_area_struct *vma)
> > +{
> > +	wait_event(vma->vm_mm->mm_wq, (atomic_cmpxchg(&vma->vm_count, 1, 0) == 1));
> > +}
> > +
> > +static void unlock_vma(struct vm_area_struct *vma)
> > +{
> > +	BUG_ON(atomic_read(&vma->vm_count));
> > +	atomic_set(&vma->vm_count, 1);
> > +}
> 
> This is a funny scheme you're trying to do in order to try to avoid
> rwsems. Of course it is subject to writer starvation, so please just
> use an rwsem per vma for this.
> 
> If the -rt tree cannot do them properly, then it just has to turn them
> into mutexes and take the hit itself.
> 
> There is no benefit for the -rt tree to do this anyway, because you're
> just re-introducing the fundamental problem that it has with rwsems
> anyway (ie. poor priority inheritance).
> 
> In this case I guess you still need some sort of refcount in order to force
> the lookup into the slowpath, but please don't use it for locking.

... though I must add that it seems like a very cool patchset and I hope
I can get time to go through it more thoroughly! Nice work ;)

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2007-03-06  8:36 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-06  1:38 [RFC][PATCH 0/5] Lockless vma lookups Peter Zijlstra
2007-03-06  1:38 ` [RFC][PATCH 1/5] RCU friendly B+tree Peter Zijlstra
2007-03-06  1:38 ` [RFC][PATCH 2/5] mm: use B+tree for vmas Peter Zijlstra
2007-03-06  1:38 ` [RFC][PATCH 3/5] mm: RCUify vma lookup Peter Zijlstra
2007-03-06  2:23   ` Nick Piggin
2007-03-06  8:36     ` Nick Piggin [this message]
2007-03-08 17:31       ` Ingo Molnar
2007-03-06 12:31     ` Peter Zijlstra
2007-03-06 12:35       ` Peter Zijlstra
2007-03-06  1:38 ` [RFC][PATCH 4/5] i386: lockless fault handler Peter Zijlstra
2007-03-06  1:38 ` [RFC][PATCH 5/5] x86_64: " Peter Zijlstra

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070306083632.GA10540@wotan.suse.de \
    --to=npiggin@suse.de \
    --cc=a.p.zijlstra@chello.nl \
    --cc=clameter@engr.sgi.com \
    --cc=linux-mm@kvack.org \
    --cc=mingo@elte.hu \
    --cc=paulmck@us.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox