]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
perf/x86/amd: Make HW_CACHE_REFERENCES and HW_CACHE_MISSES measure L2
authorMatt Fleming <matt@codeblueprint.co.uk>
Wed, 24 Aug 2016 13:12:08 +0000 (14:12 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 24 Sep 2016 08:09:35 +0000 (10:09 +0200)
commit6af2dc319f28396610891debfb1eb646ca0c82c6
treeb9b17564602ff2dbaebfcf7b6602cd8ed8c710d1
parentec929acd537f7ed1894d94af539765311a701116
perf/x86/amd: Make HW_CACHE_REFERENCES and HW_CACHE_MISSES measure L2

commit 080fe0b790ad438fc1b61621dac37c1964ce7f35 upstream.

While the Intel PMU monitors the LLC when perf enables the
HW_CACHE_REFERENCES and HW_CACHE_MISSES events, these events monitor
L1 instruction cache fetches (0x0080) and instruction cache misses
(0x0081) on the AMD PMU.

This is extremely confusing when monitoring the same workload across
Intel and AMD machines, since parameters like,

  $ perf stat -e cache-references,cache-misses

measure completely different things.

Instead, make the AMD PMU measure instruction/data cache and TLB fill
requests to the L2 and instruction/data cache and TLB misses in the L2
when HW_CACHE_REFERENCES and HW_CACHE_MISSES are enabled,
respectively. That way the events measure unified caches on both
platforms.

Signed-off-by: Matt Fleming <matt@codeblueprint.co.uk>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1472044328-21302-1-git-send-email-matt@codeblueprint.co.uk
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/events/amd/core.c
arch/x86/kvm/pmu_amd.c