mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Valdis.Kletnieks@vt.edu
Cc: Peter Zijlstra <peterz@infradead.org>,
	Thomas Gleixner <tglx@linutronix.de>, mingo <mingo@redhat.com>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] ftrace: use a global counter for the global clock
Date: Fri, 16 Sep 2011 17:37:36 -0400	[thread overview]
Message-ID: <1316209057.26295.42.camel@gandalf.stny.rr.com> (raw)
In-Reply-To: <66899.1316207693@turing-police.cc.vt.edu>

On Fri, 2011-09-16 at 17:14 -0400, Valdis.Kletnieks@vt.edu wrote:
> On Fri, 16 Sep 2011 08:18:26 EDT, Steven Rostedt said:
> 
> > +	return atomic64_add_return(1, &trace_counter);
> 
> Given that the usefulness of this is probably directly proportional to the
> number of cores on the box, is this subject to cache line ping-ponging on
> systems with many cores?

It will cause hickups, but shouldn't really change much of the ordering.
If anything, it may synchronize more.

> 
> > When debugging tight race conditions, it can be helpful to have a
> > synchronized tracing method. Although in most cases the global clock
> > provides this functionality, if timings is not the issue, it is more
> > comforting to know that the order of events really happened in a precise
> > order.
> 
> One wonders if the overhead can end up being enough to change the
> ordering, and possibly cause a heisenbug (most likely if the race condition
> involves one CPU doing something we're tracing, and another CPU doing
> something we are *not* tracing)...

My use of logdev synchronized traces like this. But it actually caught a
lot of race conditions. Really, it's about catching the ordering of what
happens in a race condition, and having the tracer actually introduce
synchronization helped in analysis. But true, as a heisenbug effect,
enabling this tracer may make the bug go away.

> 
> If that's considered not an issue, feel free to stick this on it:
> Reviewed-By: Valdis Kletnieks <valdis.kletnieks@vt.edu>

Thanks, and yes, it is not too much of a concern. It just adds another
option developers can use. Thus, if you are worried about cache line
bouncing, just use the global or local clock, otherwise use the counter.
Which I plan on documenting this side effect.

-- Steve



      reply	other threads:[~2011-09-16 21:37 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-16  9:02 Peter Zijlstra
2011-09-16 12:18 ` Steven Rostedt
2011-09-16 12:35   ` Peter Zijlstra
2011-09-16 12:36   ` Peter Zijlstra
2011-09-16 13:23     ` Steven Rostedt
2011-09-16 13:24       ` Steven Rostedt
2011-09-16 21:14   ` Valdis.Kletnieks
2011-09-16 21:37     ` Steven Rostedt [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=1316209057.26295.42.camel@gandalf.stny.rr.com \
    --to=rostedt@goodmis.org \
    --cc=Valdis.Kletnieks@vt.edu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    /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

all inboxes | Powered by JetHome®