linux/arch/x86/kernel/cpu
Peter Zijlstra f4929bd372 perf, x86: Update/fix Intel Nehalem cache events
Change the Nehalem cache events to use retired memory instruction counters
(similar to Westmere), this greatly improves the provided stats.

Using:

main ()
{
        int i;

        for (i = 0; i < 1000000000; i++) {
                asm("mov (%%rsp), %%rbx;"
                    "mov %%rbx, (%%rsp);" : : : "rbx");
        }
}

We find:

 $ perf stat --repeat 10 -e instructions:u -e l1-dcache-loads:u -e l1-dcache-stores:u ./loop_1b_loads+stores
  Performance counter stats for './loop_1b_loads+stores' (10 runs):
      4,000,081,056 instructions:u           #      0.000 IPC ( +-   0.000% )
      4,999,502,846 l1-dcache-loads:u          ( +-   0.008% )
      1,000,034,832 l1-dcache-stores:u         ( +-   0.000% )
         1.565184942  seconds time elapsed   ( +-   0.005% )

The 5b is surprising - we'd expect 1b:

 $ perf stat --repeat 10 -e instructions:u -e r10b:u -e l1-dcache-stores:u ./loop_1b_loads+stores
  Performance counter stats for './loop_1b_loads+stores' (10 runs):
      4,000,081,054 instructions:u           #      0.000 IPC ( +-   0.000% )
      1,000,021,961 r10b:u                     ( +-   0.000% )
      1,000,030,951 l1-dcache-stores:u         ( +-   0.000% )
         1.565055422  seconds time elapsed   ( +-   0.003% )

Which this patch thus fixes.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Lin Ming <ming.m.lin@intel.com>
Cc: Cyrill Gorcunov <gorcunov@openvz.org>
Link: http://lkml.kernel.org/n/tip-q9rtru7b7840tws75xzboapv@git.kernel.org
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2011-04-22 13:50:27 +02:00
..
cpufreq Merge branch 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2011-03-18 10:45:21 -07:00
mcheck rcu: create new rcu_access_index() and use in mce 2011-04-01 07:27:31 -07:00
mtrr x86, mtrr, pat: Fix one cpu getting out of sync during resume 2011-03-29 16:17:42 -07:00
.gitignore Update .gitignore files for generated targets 2008-10-20 11:24:31 -07:00
Makefile Merge branch 'x86-asm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2010-08-06 10:07:34 -07:00
amd.c x86, amd: Disable GartTlbWlkErr when BIOS forgets it 2011-04-15 16:03:16 -07:00
bugs.c x86: Avoid check hlt for newer cpus 2010-05-07 15:31:17 -07:00
bugs_64.c x86/cpu: Clean up various files a bit 2009-07-11 11:24:09 +02:00
centaur.c x86, cpu: mv display_cacheinfo -> cpu_detect_cache_sizes 2009-11-23 11:59:53 -08:00
common.c Merge branch 'x86-mm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2011-03-15 19:49:10 -07:00
cpu.h Merge branch 'x86-cpu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2010-10-21 13:18:36 -07:00
cyrix.c x86, cpu: mv display_cacheinfo -> cpu_detect_cache_sizes 2009-11-23 11:59:53 -08:00
hypervisor.c Introduce CONFIG_XEN_PVHVM compile option 2010-07-29 11:11:33 -07:00
intel.c x86: Unify CPU -> NUMA node mapping between 32 and 64bit 2011-01-28 14:54:09 +01:00
intel_cacheinfo.c Merge branch 'x86-mm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2011-03-15 19:49:10 -07:00
mkcapflags.pl x86: generate names for /proc/cpuinfo from <asm/cpufeature.h> 2008-08-27 19:23:22 -07:00
mshyperv.c x86: Export the symbol ms_hyperv 2010-07-08 14:12:03 -07:00
perf_event.c x86, perf event: Turn off unstructured raw event access to offcore registers 2011-04-22 10:02:53 +02:00
perf_event_amd.c perf, x86: Fix AMD family 15h FPU event constraints 2011-04-19 10:07:55 +02:00
perf_event_intel.c perf, x86: Update/fix Intel Nehalem cache events 2011-04-22 13:50:27 +02:00
perf_event_intel_ds.c perf, x86: Use INTEL_*_CONSTRAINT() for all PEBS event constraints 2011-03-16 14:04:12 +01:00
perf_event_intel_lbr.c perf, x86: Clean up debugctlmsr bit definitions 2010-03-26 09:41:03 +01:00
perf_event_p4.c perf, x86: P4 PMU - Don't forget to clear cpuc->active_mask on overflow 2011-04-22 10:21:34 +02:00
perf_event_p6.c perf, x86: Store perfctr msr addresses in config_base/event_base 2011-02-16 13:30:52 +01:00
perfctr-watchdog.c perf, x86: Add new AMD family 15h msrs to perfctr reservation code 2011-02-16 13:30:50 +01:00
powerflags.c x86: generate names for /proc/cpuinfo from <asm/cpufeature.h> 2008-08-27 19:23:22 -07:00
proc.c Merge branch 'x86-cpu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2009-09-14 07:57:32 -07:00
scattered.c Merge branch 'x86-amd-nb-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2010-10-21 13:01:08 -07:00
sched.c sched: x86: Name old_perf in a unique way 2009-09-16 11:21:07 +02:00
topology.c x86, cpu: Split addon_cpuid_features.c 2010-07-19 19:02:41 -07:00
transmeta.c x86, cpu: mv display_cacheinfo -> cpu_detect_cache_sizes 2009-11-23 11:59:53 -08:00
umc.c x86: move various CPU initialization objects into .cpuinit.rodata 2009-03-12 13:13:07 +01:00
vmware.c x86: Fix common misspellings 2011-03-18 10:39:30 +01:00