mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Liang, Kan" <kan.liang@linux.intel.com>
To: Stephane Eranian <eranian@google.com>, Andi Kleen <ak@linux.intel.com>
Cc: Kyle Huey <me@kylehuey.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@kernel.org>,
	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>,
	Thomas Gleixner <tglx@linutronix.de>,
	Vince Weaver <vincent.weaver@maine.edu>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [REGRESSION] x86, perf: counter freezing breaks rr
Date: Thu, 29 Nov 2018 09:50:09 -0500	[thread overview]
Message-ID: <14bdaa24-f7da-7f4d-b5b6-058322fb4af6@linux.intel.com> (raw)
In-Reply-To: <CABPqkBQseMq2xnvw71VXT6F=ZR57L+HUAmQ_dZY356Et8NpxQg@mail.gmail.com>



On 11/27/2018 8:25 PM, Stephane Eranian wrote:
> On Tue, Nov 27, 2018 at 3:36 PM Andi Kleen <ak@linux.intel.com> wrote:
>>
>>> It does seem that FREEZE_PERFMON_ON_PMI (misnamed as it is) is of
>>> rather limited use (or even negative, in our case) to a counter that's
>>> already restricted to ring 3.
>>
>> It's much faster. The PMI cost goes down dramatically.
>>
>> I still the the right fix is to add an perf event opt-out and let it be
>> used by rr.
>>
>>     V3 is without counter freezing.
>>      V4 is with counter freezing.
>>      The value is the average cost of the PMI handler.
>>      (lower is better)
>>
>>      perf options    `           V3(ns) V4(ns)  delta
>>      -c 100000                   1088   894     -18%
>>      -g -c 100000                1862   1646    -12%
>>      --call-graph lbr -c 100000  3649   3367    -8%
>>      --c.g. dwarf -c 100000      2248   1982    -12%
>>
> Is that measured on the same machine, i.e., do you force V3 on Skylake?

Yes, it's measured on same Kabylake machine with counter_freezing option 
disabled/enabled.


> All it does, I think, is save one wrmsr(GLOBAL_CTLR) on entry to the
> PMU interrupt handler or am I missing something?
> Or does it save two? The wrmsr(GLOBAL_CTRL) at the end to reactivate.

__intel_pmu_disable_all() and __intel_pmu_enable_all() are not called in 
V4 handler. So save at least two wrmsrl.

Thanks,
Kan



  reply	other threads:[~2018-11-29 14:50 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-20 16:19 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
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 [this message]
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=14bdaa24-f7da-7f4d-b5b6-058322fb4af6@linux.intel.com \
    --to=kan.liang@linux.intel.com \
    --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=linux-kernel@vger.kernel.org \
    --cc=me@kylehuey.com \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.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

all inboxes | Powered by JetHome®