From: Andi Kleen <andi@firstfloor.org>
To: Jiri Kosina <jkosina@suse.cz>
Cc: Ingo Molnar <mingo@elte.hu>, linux-kernel@vger.kernel.org
Subject: Re: spinlocks -- why are releases inlined and acquires are not?
Date: 01 Apr 2008 13:12:09 +0200 [thread overview]
Message-ID: <874pal25iu.fsf@basil.nowhere.org> (raw)
In-Reply-To: <Pine.LNX.4.64.0804011034410.5541@jikos.suse.cz>
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...
next prev parent reply other threads:[~2008-04-01 11:12 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-01 0:08 spinlocks -- why are releases inlined and acquires are not? Jiri Kosina
2008-04-01 0:40 ` Jiri Kosina
2008-04-01 8:33 ` Ingo Molnar
2008-04-01 8:38 ` Jiri Kosina
2008-04-01 8:43 ` Ingo Molnar
2008-04-01 8:44 ` Jiri Kosina
2008-04-01 11:12 ` Andi Kleen [this message]
2008-04-01 12:40 ` Jiri Kosina
2008-04-01 13:30 ` Andi Kleen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=874pal25iu.fsf@basil.nowhere.org \
--to=andi@firstfloor.org \
--cc=jkosina@suse.cz \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.