public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Frederic Weisbecker <fweisbec@gmail.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@elte.hu>, LKML <linux-kernel@vger.kernel.org>,
	Steven Rostedt <rostedt@goodmis.org>
Subject: Re: [PATCH] lockdep: Make lockstats counting per cpu
Date: Tue, 6 Apr 2010 11:24:26 +0200	[thread overview]
Message-ID: <20100406092422.GA5147@nowhere> (raw)
In-Reply-To: <1270543587.1597.742.camel@laptop>

On Tue, Apr 06, 2010 at 10:46:27AM +0200, Peter Zijlstra wrote:
> On Tue, 2010-04-06 at 00:10 +0200, Frederic Weisbecker wrote:
> > Locking statistics are implemented using global atomic variables.
> > This is usually fine unless some path write them very often.
> > 
> > This is the case for the function and function graph tracers
> > that disable irqs for each entry saved (except if the function
> > tracer is in preempt disabled only mode).
> > And calls to local_irq_save/restore() increment hardirqs_on_events
> > and hardirqs_off_events stats (or similar stats for redundant
> > versions).
> > 
> > Incrementing these global vars for each function ends up in too
> > much cache bouncing if lockstats are enabled.
> > 
> > To solve this, implement the debug_atomic_*() operations using
> > per cpu vars.
> > 
> > 
> 
> So I really have to ask, why?
> 
> This is CONFIG_DEBUG_LOCKDEP code, so its default off, and used to debug
> lockdep. Debug code should be as simple as possible, and preferably
> should not care about performance where possible.
> 
> So why complicate this?


Because when people report softlockups or big slowdowns with the function
(graph) tracers, I want to avoid asking them each time if they have
CONFIG_DEBUG_LOCKDEP enabled.

We call local_irq_disabled/enabled for each functions with these tracers.
And now that trace_clock() does that too, we do it twice.

I agree with you that simplicity must be a primary rule for debugging code,
but this role should be reconsidered when it roughly slows down the system.

This is also the responsibility of debugging code to ensure it doesn't break
things, except for corner cases hard to work around the natural starvation
they cause, like soft branch tracer or so.


  reply	other threads:[~2010-04-06  9:24 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-28  0:29 [PATCH v3] lockdep: Make lockstats counting per cpu Frederic Weisbecker
2010-04-04 14:50 ` Frederic Weisbecker
2010-04-05 22:10 ` [PATCH] " Frederic Weisbecker
2010-04-06  8:32   ` [tip:core/locking] lockstat: Make lockstat " tip-bot for Frederic Weisbecker
2010-04-06  8:46   ` [PATCH] lockdep: Make lockstats " Peter Zijlstra
2010-04-06  9:24     ` Frederic Weisbecker [this message]
2010-04-06  9:25     ` Frederic Weisbecker
  -- strict thread matches above, loose matches on Subject: below --
2010-03-26  2:22 Frederic Weisbecker
2010-03-26  3:11 ` Frederic Weisbecker
2010-03-26  3:13   ` Frederic Weisbecker
2010-03-26  9:16   ` Ingo Molnar
2010-03-26 17:11     ` Frederic Weisbecker
2010-03-26  6:52 ` Peter Zijlstra
2010-03-26  7:48   ` Peter Zijlstra
2010-03-26 17:43     ` Frederic Weisbecker
2010-03-26 17:39   ` 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=20100406092422.GA5147@nowhere \
    --to=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.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