public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Andi Kleen <ak@linux.intel.com>
Cc: Kyle Huey <me@kylehuey.com>,
	Kan Liang <kan.liang@linux.intel.com>,
	Ingo Molnar <mingo@kernel.org>,
	Robert O'Callahan <robert@ocallahan.org>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	Jiri Olsa <jolsa@redhat.com>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Stephane Eranian <eranian@google.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Vince Weaver <vincent.weaver@maine.edu>,
	acme@kernel.org, open list <linux-kernel@vger.kernel.org>
Subject: Re: [REGRESSION] x86, perf: counter freezing breaks rr
Date: Tue, 20 Nov 2018 23:16:42 +0100	[thread overview]
Message-ID: <20181120221642.GE2131@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <20181120201144.GD13936@tassilo.jf.intel.com>

On Tue, Nov 20, 2018 at 12:11:44PM -0800, Andi Kleen wrote:
> > > > Given that we're already at rc3, and that this renders rr unusable,
> > > > we'd ask that counter freezing be disabled for the 4.20 release.
> > >
> > > The boot option should be good enough for the release?
> > 
> > I'm not entirely sure what you mean here. We want you to flip the
> > default boot option so this feature is off for this release. i.e. rr
> > should work by default on 4.20 and people should have to opt into the
> > inaccurate behavior if they want faster PMI servicing.
> 
> I don't think it's inaccurate, it's just different 
> than what you are used to.
> 
> For profiling including the kernel it's actually far more accurate
> because the count is stopped much earlier near the sampling
> point. Otherwise there is a considerable over count into
> the PMI handler.
> 
> In your case you limit the count to ring 3 so it's always cut off
> at the transition point into the kernel, while with freezing
> it's at the overflow point.

Ooh, so the thing does FREEZE_ON_OVERFLOW _not_ FREEZE_ON_PMI. Yes, that
can be a big difference.

See, FREEZE_ON_PMI, as advertised by the name, should have no observable
effect on counters limited to USR. But something like FREEZE_ON_OVERFLOW
will loose everything between the overflow and the eventual PMI, and by
freezing early we can't even compensate for it anymore either,
introducing drift in the period.

And I don't buy the over-count argument, the counter register shows how
far over you are; it triggers the overflow when we cross 0, it then
continues counting. So if you really care, you can throw away the
'over-count' at PMI time. That doesn't make it more reliable. We don't
magically get pt_regs from earlier on or any other state.

The only thing where it might make a difference is if you're running
multiple counters (groups in perf speak) and want to correlate the count
values. Then, and only then, does it matter.

Bah.

  parent reply	other threads:[~2018-11-20 22:17 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-20 16:19 [REGRESSION] x86, perf: counter freezing breaks rr Kyle Huey
2018-11-20 17:08 ` Peter Zijlstra
2018-11-20 17:59   ` [tip:perf/urgent] perf/x86/intel: Fix regression by default disabling perfmon v4 interrupt handling tip-bot for Peter Zijlstra
2018-11-20 18:20   ` [REGRESSION] x86, perf: counter freezing breaks rr Stephane Eranian
2018-11-20 19:50     ` Kyle Huey
2018-11-20 19:41 ` Andi Kleen
2018-11-20 19:54   ` Kyle Huey
2018-11-20 20:11     ` Andi Kleen
2018-11-20 20:53       ` Kyle Huey
2018-11-20 21:18         ` Andi Kleen
2018-11-20 21:46           ` Kyle Huey
2018-11-20 22:19             ` Andi Kleen
2018-11-20 21:19         ` Stephane Eranian
2018-11-20 21:34           ` Kyle Huey
2018-11-20 22:16       ` Peter Zijlstra [this message]
2018-11-20 22:25         ` Peter Zijlstra
2018-11-20 22:38           ` Andi Kleen
2018-11-21  8:14             ` Peter Zijlstra
2018-11-27 22:08               ` Kyle Huey
2018-11-27 23:36                 ` Andi Kleen
2018-11-28  1:25                   ` Stephane Eranian
2018-11-29 14:50                     ` Liang, Kan
2018-11-29 15:35                   ` Peter Zijlstra

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=20181120221642.GE2131@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=acme@kernel.org \
    --cc=acme@redhat.com \
    --cc=ak@linux.intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=eranian@google.com \
    --cc=jolsa@redhat.com \
    --cc=kan.liang@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=me@kylehuey.com \
    --cc=mingo@kernel.org \
    --cc=robert@ocallahan.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=vincent.weaver@maine.edu \
    /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