From: Chris Mason <chris.mason@oracle.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Ingo Molnar <mingo@elte.hu>, Matthew Wilcox <matthew@wil.cx>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
Gregory Haskins <ghaskins@novell.com>,
Andi Kleen <andi@firstfloor.org>,
Andrew Morton <akpm@linux-foundation.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
linux-fsdevel <linux-fsdevel@vger.kernel.org>,
linux-btrfs <linux-btrfs@vger.kernel.org>,
Thomas Gleixner <tglx@linutronix.de>,
Nick Piggin <npiggin@suse.de>,
Peter Morreale <pmorreale@novell.com>,
Sven Dietrich <SDietrich@novell.com>,
Dmitry Adamushko <dmitry.adamushko@gmail.com>,
Johannes Weiner <hannes@cmpxchg.org>
Subject: Re: [GIT PULL] adaptive spinning mutexes
Date: Thu, 15 Jan 2009 16:04:18 -0500 [thread overview]
Message-ID: <1232053458.8269.139.camel@think.oraclecorp.com> (raw)
In-Reply-To: <alpine.LFD.2.00.0901151208310.6528@localhost.localdomain>
On Thu, 2009-01-15 at 12:13 -0800, Linus Torvalds wrote:
>
> On Thu, 15 Jan 2009, Chris Mason wrote:
>
> > On Thu, 2009-01-15 at 10:16 -0800, Linus Torvalds wrote:
> > >
> > > Umm. Except if you wrote the code nicely and used spinlocks, you wouldn't
> > > hold the lock over all those unnecessary and complex operations.
> >
> > While this is true, there are examples of places we should expect
> > speedups for this today.
>
> Sure. There are cases where we do have to use sleeping things, because the
> code is generic and really can't control what lower levels do, and those
> lower levels have to be able to sleep.
>
> So:
>
> > Concurrent file creation/deletion in a single dir will often find things
> > hot in cache and not have to block anywhere (mail spools).
>
> The inode->i_mutex thing really does need to use a mutex, and spinning
> will help. Of course, it should only help when you really have lots of
> concurrent create/delete/readdir in the same directory, and that hopefully
> is a very rare load in real life, but hey, it's a valid one.
>
Mail server deletes is the common one I can think of. Mail server
creates end up bound by fsync in my testing here, so it doesn't quite
show up unless your IO subsystem is much faster than your kernel.
> > Concurrent O_DIRECT aio writes to the same file, where i_mutex is
> > dropped early on.
>
> Won't the actual IO costs generally dominate in everything but trivial
> benchmarks?
Benchmarks in the past on large IO rigs have shown it. It isn't
something you're going to see on a regular sized server, but for AIO +
O_DIRECT, the pieces that hold i_mutex can be seen in real life.
[ re: pipes, ok I don't know of realistic pipe benchmarks but I'll run
them if people can suggest one ]
I ran a mailserver delivery simulation (fs_mark), and then my standard
dbench/4k creates/4k stats on ext3 and ext4.
ext3 had very similar scores with spinning on and off.
ext4 scored the same on mailserver delivery (fsync bound apparently)
For the others:
dbench no spin: 1970MB/s
dbench spin: 3036MB/s
(4k creates in file/sec, higher is better)
4k creates no spin: avg 418.91 median 346.12 std 306.37 high 2025.80 low 338.11
4k creates spin: avg 406.09 median 344.27 std 179.95 high 1249.78 low 336.10
Somehow the spinning mutex made ext4 more fair. The 4k create test had
50 procs doing file creates in parallel, but each proc was operating in
its own directory. So, they shouldn't actually be competing for any of
the VFS mutexes.
The stat run was the same patched/unpatched, probably for the same
reason.
None of this is very earth shattering, apparently my canned benchmarks
for btrfs pain points don't apply that well to ext34.
-chris
next prev parent reply other threads:[~2009-01-15 21:04 UTC|newest]
Thread overview: 92+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-12 15:37 [PATCH -v8][RFC] mutex: implement adaptive spinning Peter Zijlstra
2009-01-12 16:04 ` Linus Torvalds
2009-01-12 16:20 ` Linus Torvalds
2009-01-12 16:45 ` Chris Mason
2009-01-12 16:50 ` Peter Zijlstra
2009-01-12 17:14 ` Chris Mason
2009-01-12 17:24 ` Peter Zijlstra
2009-01-12 17:30 ` Chris Mason
2009-01-12 17:16 ` Peter Zijlstra
2009-01-12 17:33 ` Boaz Harrosh
2009-01-12 18:07 ` Peter Zijlstra
2009-01-12 16:13 ` Avi Kivity
2009-01-12 17:13 ` Peter Zijlstra
2009-01-12 17:23 ` Avi Kivity
2009-01-12 17:32 ` Avi Kivity
2009-01-14 16:46 ` Peter Zijlstra
2009-01-14 17:04 ` Nick Piggin
2009-01-14 17:23 ` Avi Kivity
2009-01-15 0:50 ` Nick Piggin
2009-01-13 15:15 ` [PATCH -v9][RFC] " Peter Zijlstra
2009-01-13 16:16 ` Linus Torvalds
2009-01-13 16:21 ` Peter Zijlstra
2009-01-13 16:39 ` Ingo Molnar
2009-01-13 16:40 ` Peter Zijlstra
2009-01-13 16:49 ` Linus Torvalds
2009-01-13 17:21 ` Peter Zijlstra
2009-01-13 18:33 ` Ingo Molnar
2009-01-13 18:40 ` Linus Torvalds
2009-01-13 19:01 ` Ingo Molnar
2009-01-14 2:58 ` Chris Mason
2009-01-14 11:18 ` Dmitry Adamushko
2009-01-14 16:47 ` Chris Mason
2009-01-14 17:32 ` Dmitry Adamushko
2009-01-14 11:21 ` Ingo Molnar
2009-01-14 15:43 ` Linus Torvalds
2009-01-14 16:23 ` Chris Mason
2009-01-14 17:06 ` [PATCH -v11 delta] " Ingo Molnar
2009-01-14 17:00 ` [PATCH -v11][RFC] " Peter Zijlstra
2009-01-14 17:18 ` Nick Piggin
2009-01-14 17:22 ` Peter Zijlstra
2009-01-15 0:46 ` Nick Piggin
2009-01-15 7:44 ` Peter Zijlstra
2009-01-15 7:52 ` Nick Piggin
2009-01-14 18:33 ` [GIT PULL] adaptive spinning mutexes Ingo Molnar
2009-01-14 18:40 ` Chris Mason
2009-01-15 9:53 ` Ingo Molnar
2009-01-14 18:47 ` Ingo Molnar
2009-01-14 19:28 ` Ingo Molnar
2009-01-15 17:44 ` Matthew Wilcox
2009-01-15 18:05 ` Linus Torvalds
2009-01-15 18:08 ` Ingo Molnar
2009-01-15 18:16 ` Linus Torvalds
2009-01-15 19:26 ` Chris Mason
2009-01-15 20:13 ` Linus Torvalds
2009-01-15 21:04 ` Chris Mason [this message]
2009-01-15 22:03 ` Ingo Molnar
2009-01-16 13:32 ` Folkert van Heusden
2009-01-16 13:57 ` Folkert van Heusden
2009-01-16 18:37 ` Bill Davidsen
2009-01-16 0:53 ` Paul E. McKenney
2009-01-16 1:01 ` Linus Torvalds
2009-01-16 1:34 ` Paul E. McKenney
2009-01-16 14:07 ` Folkert van Heusden
2009-01-16 3:03 ` Nick Piggin
2009-01-15 18:06 ` Ingo Molnar
2009-01-14 18:53 ` Andrew Morton
2009-01-14 19:00 ` Ingo Molnar
2009-01-14 19:36 ` Andrew Morton
2009-01-14 19:50 ` Peter Zijlstra
2009-01-14 20:21 ` Andrew Morton
2009-01-14 20:27 ` Ingo Molnar
2009-01-14 20:44 ` Andrew Morton
2009-01-14 20:14 ` Ingo Molnar
2009-01-14 20:30 ` Andrew Morton
2009-01-14 20:51 ` Ingo Molnar
2009-01-14 21:06 ` Andrew Morton
2009-01-14 21:14 ` Ingo Molnar
2009-01-14 21:35 ` Andrew Morton
2009-01-14 23:23 ` Ingo Molnar
2009-01-15 0:55 ` Nick Piggin
2009-01-14 21:41 ` Ingo Molnar
2009-01-14 21:50 ` Kay Sievers
2009-01-14 22:34 ` Ingo Molnar
2009-01-15 11:45 ` Folkert van Heusden
2009-01-15 12:53 ` Chris Samuel
2009-01-14 19:23 ` Peter Zijlstra
2009-01-14 19:33 ` Ingo Molnar
2009-01-15 8:41 ` [PATCH] mutex: set owner only once on acquisition Johannes Weiner
2009-01-15 8:56 ` Johannes Weiner
2009-01-13 18:12 ` [PATCH -v9][RFC] mutex: implement adaptive spinning Ingo Molnar
2009-01-13 18:21 ` Linus Torvalds
2009-01-13 18:24 ` Ingo Molnar
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=1232053458.8269.139.camel@think.oraclecorp.com \
--to=chris.mason@oracle.com \
--cc=SDietrich@novell.com \
--cc=a.p.zijlstra@chello.nl \
--cc=akpm@linux-foundation.org \
--cc=andi@firstfloor.org \
--cc=dmitry.adamushko@gmail.com \
--cc=ghaskins@novell.com \
--cc=hannes@cmpxchg.org \
--cc=linux-btrfs@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=matthew@wil.cx \
--cc=mingo@elte.hu \
--cc=npiggin@suse.de \
--cc=paulmck@linux.vnet.ibm.com \
--cc=pmorreale@novell.com \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.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