lkml.org 
[lkml]   [2013]   [Oct]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] rwsem: reduce spinlock contention in wakeup code path

* Peter Zijlstra <peterz@infradead.org> wrote:

> On Tue, Oct 01, 2013 at 09:28:15AM +0200, Ingo Molnar wrote:
>
> > That I mostly agree with, except that without a serious usecase do we
> > have a guarantee that bugs in fancies queueing in rwsems gets ironed
> > out?
>
> Methinks mmap_sem is still a big enough lock to work out a locking
> primitive :-)

I mean the AIM7 usecase probably falls away - we need to find another one
that shows the inefficiencies.

> In fact, try something like this from userspace:
>
> n-threads:
>
> pthread_mutex_lock(&mutex);
> foo = mmap();
> pthread_mutex_lock(&mutex);
>
> /* work */
>
> pthread_mutex_unlock(&mutex);
> munma(foo);
> pthread_mutex_unlock(&mutex);
>
> vs
>
> n-threads:
>
> foo = mmap();
> /* work */
> munmap(foo);
>
>
> I've had reports that the former was significantly faster than the
> latter.

That looks like a legitimate pattern that ought to trigger in many apps.
Would be nice to turn this into a:

perf bench mm thread-create

testcase or so.

Thanks,

Ingo


\
 
 \ /
  Last update: 2013-10-01 10:41    [W:0.087 / U:0.260 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site