public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Waiman Long <waiman.long@hp.com>
To: Alexander Viro <viro@zeniv.linux.org.uk>,
	Thomas Gleixner <tglx@linutronix.de>
Cc: Waiman Long <Waiman.Long@hp.com>,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	"Chandramouleeswaran, Aswin" <aswin@hp.com>,
	"Norton, Scott J" <scott.norton@hp.com>
Subject: Re: [PATCH 0/4] seqlock: Add new blocking reader type & use rwlock
Date: Fri, 23 Aug 2013 18:49:54 -0400	[thread overview]
Message-ID: <5217E712.5030008@hp.com> (raw)
In-Reply-To: <1372902738-30693-1-git-send-email-Waiman.Long@hp.com>

On 07/03/2013 09:52 PM, Waiman Long wrote:
> During some perf-record sessions of the kernel running the high_systime
> workload of the AIM7 benchmark, it was found that quite a large portion
> of the spinlock contention was due to the perf_event_mmap_event()
> function itself. This perf kernel function calls d_path() which,
> in turn, call path_get() and dput() indirectly. These 3 functions
> were the hottest functions shown in the perf-report output of
> the _raw_spin_lock() function in an 8-socket system with 80 cores
> (hyperthreading off) with a 3.10-rc1 kernel:
>
> -  13.91%           reaim  [kernel.kallsyms]     [k] _raw_spin_lock
>     - _raw_spin_lock
>        + 35.54% path_get
>        + 34.85% dput
>        + 19.49% d_path
>
> In fact, the output of the "perf record -s -a" (without call-graph)
> showed:
>
>   13.37%           reaim  [kernel.kallsyms]     [k] _raw_spin_lock
>    7.61%              ls  [kernel.kallsyms]     [k] _raw_spin_lock
>    3.54%            true  [kernel.kallsyms]     [k] _raw_spin_lock
>
> Without using the perf monitoring tool, the actual execution profile
> will be quite different. In fact, with this patch set and my other
> lockless reference count update patch applied, the output of the same
> "perf record -s -a" command became:
>
>    2.82%           reaim  [kernel.kallsyms]     [k] _raw_spin_lock
>    1.11%              ls  [kernel.kallsyms]     [k] _raw_spin_lock
>    0.26%            true  [kernel.kallsyms]     [k] _raw_spin_lock
>
> So the time spent on _raw_spin_lock() function went down from 24.52%
> to 4.19%. It can be seen that the performance data collected by the
> perf-record command can be heavily skewed in some cases on a system
> with a large number of CPUs. This set of patches enables the perf
> command to give a more accurate and reliable picture of what is really
> happening in the system. At the same time, they can also improve the
> general performance of systems especially those with a large number
> of CPUs.
>
> The d_path() function takes the following two locks:
>
> 1. dentry->d_lock [spinlock] from dget()/dget_parent()/dput()
> 2. rename_lock    [seqlock]  from d_path()
>
> This set of patches address the rename_lock bottleneck by changing the
> way seqlock is implemented so that we can optionally use a read/write
> lock as the underlying implementation instead of the default spinlock.
>
> Incidentally, this patch also provides slight 5% performance boost
> over just the the lockless reference count update patch in the short
> workload of the AIM7 benchmark running on a 8-socket 80-core DL980
> machine on a 3.10-based kernel. There were still a few percentage
> points of contention in d_path() and getcwd syscall left due to their
> use of the rename_lock.
>
> Signed-off-by: Waiman Long<Waiman.Long@hp.com>
>
> Waiman Long (4):
>    seqlock: Add a new blocking reader type
>    dcache: Use blocking reader seqlock when protected data are not
>      changed
>    seqlock: Allow the use of rwlock in seqlock
>    dcache: Use rwlock as the underlying lock in rename_lock
>
>   fs/dcache.c             |   28 ++++----
>   include/linux/seqlock.h |  167 ++++++++++++++++++++++++++++++++++++++++-------
>   2 files changed, 158 insertions(+), 37 deletions(-)
>

I haven't received any feedback on this patchset. Would you mind letting 
me know if any further change will be needed to make it acceptable to be 
merged?

Thank,
Longman

      parent reply	other threads:[~2013-08-23 22:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-04  1:52 [PATCH 0/4] seqlock: Add new blocking reader type & use rwlock Waiman Long
2013-07-04  1:52 ` [PATCH 1/4] seqlock: Add a new blocking reader type Waiman Long
2013-07-04  1:52 ` [PATCH 2/4] dcache: Use blocking reader seqlock when protected data are not changed Waiman Long
2013-07-04  1:52 ` [PATCH 3/4] seqlock: Allow the use of rwlock in seqlock Waiman Long
2013-07-04  1:52 ` [PATCH 4/4] dcache: Use rwlock as the underlying lock in rename_lock Waiman Long
2013-08-23 22:49 ` Waiman Long [this message]

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=5217E712.5030008@hp.com \
    --to=waiman.long@hp.com \
    --cc=aswin@hp.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=scott.norton@hp.com \
    --cc=tglx@linutronix.de \
    --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