mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Steven Rostedt <srostedt@redhat.com>
To: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
Cc: Ingo Molnar <mingo@elte.hu>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp>,
	linux-kernel@vger.kernel.org,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Paul Mackerras <paulus@samba.org>,
	Tom Zanussi <tzanussi@gmail.com>,
	KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Subject: Re: [PATCH 2/2] perf lock: New subcommand "lock" to perf for analyzing lock statistics
Date: Mon, 07 Dec 2009 11:38:05 -0500	[thread overview]
Message-ID: <1260203885.31359.177.camel@localhost.localdomain> (raw)
In-Reply-To: <4B1CBEEB.3090800@cn.fujitsu.com>

On Mon, 2009-12-07 at 16:38 +0800, Xiao Guangrong wrote:
> 
> Ingo Molnar wrote:
> 
> > Also, i agree that the performance aspect is probably the most pressing 
> > issue. Note that 'perf bench sched messaging' is very locking intense so 
> > a 10x slowdown is not entirely unexpected - we still ought to optimize 
> > it all some more. 'perf lock' is an excellent testcase for this in any 
> > case.
> > 
> 
> Here are some test results to show the overhead of lockdep trace events:
> 
>                    select    pagefault   mmap    Memory par   Cont_SW
>                    latency    latency   latency   R/W BD      latency
> 
> disable ftrace        0         0         0         0          0
> 
> enable all ftrace  -16.65%    -109.80%   -93.62%   0.14%      -6.94%
> 
> enable all ftrace  -2.67%      1.08%     -3.65%   -0.52%      -0.68%
> except lockdep
> 
> 
> We also found big overhead when using kernbench and fio, but we haven't
> verified whether it's caused by lockdep events.

Well, it is expected that recording all locking is going to have a
substantial overhead. In my measurements, a typical event takes around
250ns per event (note, I've gotten this down to 140ns in recent updates,
and even 90ns by disabling integrity checks, but I don't want to disable
those checks in production).

Anyway, if you add just 100ns to every lock taken in the kernel, that
will definitely increase the overhead. Just enable spin_lock() in the
function tracer and watch the performance go down.  This is why, when
using the function tracer I usually add all locking to the notrace
filter. This alone helps tremendously in tracing functions.

-- Steve



  parent reply	other threads:[~2009-12-07 16:38 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-12  6:43 [PATCH][RFC] Measuring term of acquiring spinlock Hitoshi Mitake
2009-11-12  7:39 ` Ingo Molnar
2009-11-13  4:21   ` Hitoshi Mitake
2009-11-13  8:17     ` Ingo Molnar
2009-11-13  8:24       ` Peter Zijlstra
2009-11-13  8:40       ` Frederic Weisbecker
2009-11-13  8:51         ` Ingo Molnar
2009-11-13  9:06           ` [PATCH] tracing: Rename lockdep event subsystem into lock Frederic Weisbecker
2009-11-13  9:10             ` Peter Zijlstra
2009-11-13  9:26               ` Ingo Molnar
2009-11-13  9:36               ` Frederic Weisbecker
2009-11-13  9:31             ` [tip:perf/core] tracing: Rename 'lockdep' event subsystem into 'lock' tip-bot for Frederic Weisbecker
2009-11-13  9:57             ` tip-bot for Frederic Weisbecker
2009-11-13 10:51     ` [PATCH][RFC] Measuring term of acquiring spinlock Frederic Weisbecker
2009-11-15  1:20       ` Hitoshi Mitake
2009-11-15  2:21         ` Frederic Weisbecker
2009-11-15  8:38           ` Hitoshi Mitake
2009-12-07  3:34           ` [PATCH 1/2] Does raw_field_ptr() supports __data_loc? Hitoshi Mitake
2009-12-07  4:02             ` Frederic Weisbecker
2009-12-07 16:09             ` Steven Rostedt
2009-12-07  3:34           ` [PATCH 2/2] perf lock: New subcommand "lock" to perf for analyzing lock statistics Hitoshi Mitake
2009-12-07  4:41             ` Frederic Weisbecker
2009-12-07  7:27               ` Ingo Molnar
2009-12-07  8:38                 ` Xiao Guangrong
2009-12-07 15:00                   ` Hitoshi Mitake
2009-12-07 16:38                   ` Steven Rostedt [this message]
2009-12-07 19:48                   ` Frederic Weisbecker
2009-12-07 19:57                     ` Frederic Weisbecker
2009-12-08  1:31                     ` Xiao Guangrong
2009-12-07 14:57                 ` Hitoshi Mitake
2009-12-07 14:51               ` Hitoshi Mitake
2009-12-07 20:16                 ` Frederic Weisbecker

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=1260203885.31359.177.camel@localhost.localdomain \
    --to=srostedt@redhat.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=fweisbec@gmail.com \
    --cc=kosaki.motohiro@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=mitake@dcl.info.waseda.ac.jp \
    --cc=paulus@samba.org \
    --cc=tzanussi@gmail.com \
    --cc=xiaoguangrong@cn.fujitsu.com \
    /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

Powered by JetHome