From: Ingo Molnar <mingo@kernel.org>
To: Andi Kleen <andi@firstfloor.org>
Cc: linux-kernel@vger.kernel.org, eranian@google.com,
Andi Kleen <ak@linux.intel.com>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Arnaldo Carvalho de Melo <acme@infradead.org>
Subject: Re: [PATCH 4/5] perf, x86: Support full width counting v2
Date: Tue, 12 Feb 2013 09:42:50 +0100 [thread overview]
Message-ID: <20130212084250.GA19475@gmail.com> (raw)
In-Reply-To: <1360265019-23865-5-git-send-email-andi@firstfloor.org>
* Andi Kleen <andi@firstfloor.org> wrote:
> From: Andi Kleen <ak@linux.intel.com>
>
> Recent Intel CPUs like Haswell and IvyBridge have a new alternative MSR
> range for perfctrs that allows writing the full counter width. Enable this
> range if the hardware reports it using a new capability bit.
>
> This lowers the overhead of perf stat slightly because it has to do less
> interrupts to accumulate the counter value. On Haswell it also avoids some
> problems with TSX aborting when the end of the counter range is reached.
>
> v2: Print the feature at boot
> Reviewed-by: Stephane Eranian <eranian@google.com>
> Signed-off-by: Andi Kleen <ak@linux.intel.com>
> ---
> arch/x86/include/uapi/asm/msr-index.h | 3 +++
> arch/x86/kernel/cpu/perf_event.h | 1 +
> arch/x86/kernel/cpu/perf_event_intel.c | 7 +++++++
> 3 files changed, 11 insertions(+), 0 deletions(-)
>
> diff --git a/arch/x86/include/uapi/asm/msr-index.h b/arch/x86/include/uapi/asm/msr-index.h
> index 433a59f..af41a77 100644
> --- a/arch/x86/include/uapi/asm/msr-index.h
> +++ b/arch/x86/include/uapi/asm/msr-index.h
> @@ -163,6 +163,9 @@
> #define MSR_KNC_EVNTSEL0 0x00000028
> #define MSR_KNC_EVNTSEL1 0x00000029
>
> +/* Alternative perfctr range with full access. */
> +#define MSR_IA32_PMC0 0x000004c1
> +
> /* AMD64 MSRs. Not complete. See the architecture manual for a more
> complete list. */
>
> diff --git a/arch/x86/kernel/cpu/perf_event.h b/arch/x86/kernel/cpu/perf_event.h
> index ded4667..adaa0b0 100644
> --- a/arch/x86/kernel/cpu/perf_event.h
> +++ b/arch/x86/kernel/cpu/perf_event.h
> @@ -278,6 +278,7 @@ union perf_capabilities {
> u64 pebs_arch_reg:1;
> u64 pebs_format:4;
> u64 smm_freeze:1;
> + u64 fw_write:1;
No brownies for obfuscation: that should be named
full_width_write, not a meaningless abbreviation that anyone
crossing the code could mistake as 'firewall write' or 'forward
write' or anything.
Also a comment line at the field should explain its meaning.
Thanks,
Ingo
next prev parent reply other threads:[~2013-02-12 8:42 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-07 19:23 Basic perf PMU support for Haswell v5 Andi Kleen
2013-02-07 19:23 ` [PATCH 1/5] perf, x86: Add PEBSv2 record support v2 Andi Kleen
2013-02-12 9:02 ` Ingo Molnar
2013-02-07 19:23 ` [PATCH 2/5] perf, x86: Basic Haswell PMU support v4 Andi Kleen
2013-02-07 19:23 ` [PATCH 3/5] perf, x86: Basic Haswell PEBS " Andi Kleen
2013-02-07 19:23 ` [PATCH 4/5] perf, x86: Support full width counting v2 Andi Kleen
2013-02-12 8:42 ` Ingo Molnar [this message]
2013-02-07 19:23 ` [PATCH 5/5] perf, x86: Move NMI clearing to end of PMI handler after the counter registers are reset Andi Kleen
2013-02-12 8:43 ` Ingo Molnar
2013-02-12 15:14 ` Andi Kleen
2013-02-13 9:10 ` Ingo Molnar
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=20130212084250.GA19475@gmail.com \
--to=mingo@kernel.org \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@infradead.org \
--cc=ak@linux.intel.com \
--cc=andi@firstfloor.org \
--cc=eranian@google.com \
--cc=linux-kernel@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).