[lkml]   [2013]   [Aug]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: Performance regression from switching lock to rw-sem for anon-vma tree

* Tim Chen <> wrote:

> On Tue, 2013-08-06 at 16:55 -0700, Davidlohr Bueso wrote:
> > I got good numbers, recovering the performance drop I noticed with the
> > i_mmap_mutex to rwsem patches.
> That's good. I remembered that the earlier version of the patch not
> only recovered the performance drop, but also provide some boost when
> you switch from i_mmap_mutex to rwsem for aim7. Do you see similar
> boost with this version?
> > Looking forward to a more upstreamable
> > patchset that deals with this work, including the previous patches.
> >
> > One thing that's bugging me about this series though is the huge amount
> > of duplicated code being introduced to rwsems from mutexes. We can share
> > common functionality such as mcs locking (perhaps in a new file under
> > lib/), can_spin_on_owner() and owner_running(), perhaps moving those
> > functions into sheduler code, were AFAIK they were originally.
> I think that MCS locking is worth breaking out as its
> own library. After we've done that, the rest of
> the duplication are minimal. It is easier
> to keep them separate as there are some rwsem
> specific logic that may require tweaking
> to can_spin_on_owner and owner_running.

That's what I would strongly suggest to be the approach of these patches:
first the MCS locking factoring out, then changes in rwsem behavior.

I'd suggest the librarization should be done using inlines or so, so that
we don't touch the current (pretty good) mutex.o code generation. I.e.
code library only on the source code level.

Done that way we could also apply the librarization first, without having
to worry about performance aspects. Having the code shared will also make
sure that an improvement to the mutex slowpaths automatically carries over
into rwems and vice versa.



 \ /
  Last update: 2013-08-12 21:21    [W:0.090 / U:0.192 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site