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 thatfor i386 spin unlocks the call sequence for the sub function isactually larger in code than the actual spin unlock operation and forx86-64 it was about the same. That was not even counting any negativeregister allocation effects the call has on the caller. Spinlocksdon't clobber a lot of registers, but the compiler doesn't know thatwhen calling the function so it has to assume all ABI callee clobberedare gone.

I didn't do anything back then because at this point Ingo wasreorganizing the spinlock code hourly[1] for his lockdep etc. merge andwanted 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.