From: Peter Zijlstra <a.p.zijlstra@chello.nl>
To: Christoph Hellwig <hch@infradead.org>
Cc: Daniel Walker <dwalker@mvista.com>,
Matthew Wilcox <matthew@wil.cx>,
linux-kernel@vger.kernel.org,
Stephen Rothwell <sfr@canb.auug.org.au>
Subject: Re: Announce: Semaphore-Removal tree
Date: Sat, 26 Apr 2008 15:39:13 +0200 [thread overview]
Message-ID: <1209217153.1956.14.camel@lappy> (raw)
In-Reply-To: <20080426093048.GA11443@infradead.org>
On Sat, 2008-04-26 at 05:30 -0400, Christoph Hellwig wrote:
> On Fri, Apr 25, 2008 at 02:22:31PM -0700, Daniel Walker wrote:
> > If you can make a case for converting some semaphores to spinlocks be my
> > guest .. If you have good reasoning I wouldn't stand in the way.. (Real
> > time converts all the spinlocks to mutexes anyway ..)
>
> Right at hand I have the XFS inode hash lock was converted from a rw_semaphore
> to a rwlock_t becuase the context switch overhead was killing
> performance in various benchmarks. This is a very typical scenary for
> locks that are taken often and held for a rather short time. Add to
> that fact that a spinlock is compltely optimized away for an UP kernel
> while a mutex is not and the amount of memory that any mutex takes
> compared to a spinlock you have a clear winner.
I'm guessing RCU would be a bit more work?
The problem with rwlock_t is that for it to be a spinning lock the hold
times should be short, for it to be a rwlock over a spinlock there
should be a significant amount of concurrency, these two things together
make for a cache-line bouncing fest.
next prev parent reply other threads:[~2008-04-26 13:40 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-25 17:00 Announce: Semaphore-Removal tree Matthew Wilcox
2008-04-25 20:24 ` Daniel Walker
2008-04-25 20:38 ` Daniel Walker
2008-04-25 21:12 ` Christoph Hellwig
2008-04-25 21:22 ` Daniel Walker
2008-04-26 9:30 ` Christoph Hellwig
2008-04-26 13:39 ` Peter Zijlstra [this message]
2008-04-26 13:44 ` Christoph Hellwig
2008-04-26 14:04 ` Peter Zijlstra
2008-04-28 4:59 ` David Chinner
2008-04-26 13:54 ` Stephen Rothwell
2008-04-26 15:59 ` Matthew Wilcox
2008-04-26 16:43 ` Stephen Rothwell
2008-04-28 5:10 ` David Chinner
2008-04-28 12:20 ` Matthew Wilcox
2008-04-29 0:09 ` David Chinner
2008-04-29 2:35 ` Matthew Wilcox
2008-04-29 3:56 ` David Chinner
2008-04-30 10:21 ` Matthew Wilcox
2008-04-30 10:06 ` Matthew Wilcox
2008-04-30 11:01 ` David Chinner
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=1209217153.1956.14.camel@lappy \
--to=a.p.zijlstra@chello.nl \
--cc=dwalker@mvista.com \
--cc=hch@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=matthew@wil.cx \
--cc=sfr@canb.auug.org.au \
/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.