[lkml]   [2008]   [Apr]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: spinlocks -- why are releases inlined and acquires are not?
    Jiri Kosina <> writes:
    > In fact we have received report from one of our users that he is seeing
    > approximately 15% performance degradation of mmap() when spinlocks are not
    > inlined. I am going to do some performance measurements myself shortly, as
    > it seems quite strange, but while at it, I have noticed the aforementioned
    > asymetry in spinlock.h, so I just wanted to know if there is any
    > particular reason behind that.

    At some point -- but that was before queued locks -- I noticed that
    for i386 spin unlocks the call sequence for the sub function is
    actually larger in code than the actual spin unlock operation and for
    x86-64 it was about the same. That was not even counting any negative
    register allocation effects the call has on the caller. Spinlocks
    don't clobber a lot of registers, but the compiler doesn't know that
    when calling the function so it has to assume all ABI callee clobbered
    are gone.

    I didn't do anything back then because at this point Ingo was
    reorganizing the spinlock code hourly[1] for his lockdep etc. merge and
    wanted to wait for it to settle down and then it dropped from
    the radar.

    Anyways without queued spinlocks that has probably changed again,
    might be still worth rechecking.


    [1] ok I'm exaggerating...

     \ /
      Last update: 2008-04-01 13:15    [W:0.032 / U:3.936 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site