From: Dave Hansen <dave@sr71.net>
To: paulmck@linux.vnet.ibm.com
Cc: Andi Kleen <ak@linux.intel.com>,
dave.hansen@linux.intel.com, akpm@linux-foundation.org,
jack@suse.cz, viro@zeniv.linux.org.uk, eparis@redhat.com,
john@johnmccutchan.com, rlove@rlove.org,
tim.c.chen@linux.intel.com, linux-kernel@vger.kernel.org
Subject: Re: [RFC][PATCH] fs: optimize inotify/fsnotify code for unwatched files
Date: Sat, 20 Jun 2015 11:02:08 -0700 [thread overview]
Message-ID: <5585AAA0.1030305@sr71.net> (raw)
In-Reply-To: <20150620022135.GF3913@linux.vnet.ibm.com>
On 06/19/2015 07:21 PM, Paul E. McKenney wrote:
>>> > > What is so expensive in it? Just the memory barrier in it?
>> >
>> > The profiling doesn't hit on the mfence directly, but I assume that the
>> > overhead is coming from there. The "mov 0x8(%rdi),%rcx" is identical
>> > before and after the barrier, but it appears much more expensive
>> > _after_. That makes no sense unless the barrier is the thing causing it.
> OK, one thing to try is to simply delete the memory barrier. The
> resulting code will be unsafe, but will probably run well enough to
> get benchmark results. If it is the memory barrier, you should of
> course get increased throughput.
So I took the smp_mb() out of __srcu_read_lock(). The benchmark didn't
improve at all. Looking at the profile, all of the overhead had just
shifted to __srcu_read_unlock() and its memory barrier! Removing the
barrier in __srcu_read_unlock() got essentially the same gains out of
the benchmark as the original patch in this thread that just avoids RCU.
I think that's fairly conclusive that the source of the overhead is,
indeed, the memory barriers.
Although I said this test was single threaded, I also had another
thought. The benchmark is single-threaded, but 'perf' is sitting doing
profiling and who knows what else on the other core, and the profiling
NMIs are certainly writing plenty of data to memory. So, there might be
plenty of work for that smp_mb()/mfence to do _despite_ the benchmark
itself being single threaded.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at http://www.tux.org/lkml/
next prev parent reply other threads:[~2015-06-20 18:02 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-19 21:50 [RFC][PATCH] fs: optimize inotify/fsnotify code for unwatched files Dave Hansen
2015-06-19 23:33 ` Andi Kleen
2015-06-20 0:29 ` Paul E. McKenney
2015-06-20 0:39 ` Dave Hansen
2015-06-20 2:21 ` Paul E. McKenney
2015-06-20 18:02 ` Dave Hansen [this message]
2015-06-21 1:30 ` Paul E. McKenney
2015-06-22 13:28 ` Peter Zijlstra
2015-06-22 15:11 ` Paul E. McKenney
2015-06-22 15:20 ` Peter Zijlstra
2015-06-22 16:29 ` Paul E. McKenney
2015-06-22 19:03 ` Peter Zijlstra
2015-06-23 0:31 ` Paul E. McKenney
2015-06-22 18:50 ` Dave Hansen
2015-06-23 0:26 ` Paul E. McKenney
2015-06-24 16:50 ` Dave Hansen
2015-06-24 17:29 ` Paul E. McKenney
2015-06-22 18:52 ` Peter Zijlstra
2015-06-23 0:29 ` Paul E. McKenney
2015-06-23 15:17 ` Jan Kara
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=5585AAA0.1030305@sr71.net \
--to=dave@sr71.net \
--cc=ak@linux.intel.com \
--cc=akpm@linux-foundation.org \
--cc=dave.hansen@linux.intel.com \
--cc=eparis@redhat.com \
--cc=jack@suse.cz \
--cc=john@johnmccutchan.com \
--cc=linux-kernel@vger.kernel.org \
--cc=paulmck@linux.vnet.ibm.com \
--cc=rlove@rlove.org \
--cc=tim.c.chen@linux.intel.com \
--cc=viro@zeniv.linux.org.uk \
/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