Messages in this thread | | | Subject | Re: spinlocks -- why are releases inlined and acquires are not? | From | Andi Kleen <> | Date | 01 Apr 2008 13:12:09 +0200 |
| |
Jiri Kosina <jkosina@suse.cz> 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.
-Andi
[1] ok I'm exaggerating...
| |