From: Trond Myklebust <trond.myklebust@fys.uio.no>
To: Paul Mackerras <paulus@samba.org>
Cc: Benjamin LaHaise <bcrl@kvack.org>,
linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC] unify semaphore implementations
Date: Sat, 30 Apr 2005 12:40:29 -0400 [thread overview]
Message-ID: <1114879229.14213.18.camel@lade.trondhjem.org> (raw)
In-Reply-To: <17010.58144.95239.716600@cargo.ozlabs.ibm.com>
On lau , 2005-04-30 at 11:45 +1000, Paul Mackerras wrote:
> What is "your machine"? Is a single cmpxchg really slower than
> locking and unlocking a spinlock? If so, by how much?
Sorry. Thinking back, I realize that I was testing the non-irqsafe
spinlocks, since that was the only case that was of interest for the
iosem stuff. I should go back and test for the case of irqsafe ones.
FYI, though, the machine on which I tested it is a mobile P4. When
averaging over 1000 iterations, a single bus-locked cmpxchg took more
than twice the amount of time to complete than a single bus-locked incb
or decb (as used in the 386 spinlock implementations).
The spinlocked version was therefore not much faster for the fast path,
but for the slow path you do only a single spin_lock/spin_unlock
combination instead of cmpxchg+spinlock/spinunlock. It is therefore
twice as fast.
Cheers,
Trond
next prev parent reply other threads:[~2005-04-30 16:40 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-04-28 18:29 Benjamin LaHaise
2005-04-28 18:48 ` James Bottomley
2005-04-28 18:59 ` Benjamin LaHaise
2005-04-28 18:53 ` David S. Miller
2005-04-28 22:40 ` Russell King
2005-04-29 0:42 ` Trond Myklebust
2005-04-29 1:26 ` Paul Mackerras
2005-04-28 22:54 ` David Howells
2005-04-29 0:44 ` Paul Mackerras
2005-04-29 5:33 ` Richard Henderson
2005-04-29 14:14 ` Benjamin LaHaise
2005-04-29 15:42 ` Trond Myklebust
2005-04-30 1:45 ` Paul Mackerras
2005-04-30 5:13 ` Paul Mackerras
2005-04-30 16:40 ` Trond Myklebust [this message]
2005-04-30 1:49 ` Paul Mackerras
2005-04-30 16:50 ` Trond Myklebust
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=1114879229.14213.18.camel@lade.trondhjem.org \
--to=trond.myklebust@fys.uio.no \
--cc=bcrl@kvack.org \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=paulus@samba.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®