linux-kernel-test/arch/x86/kernel/cpu
Cyrill Gorcunov 137351e0fe x86, perf: P4 PMU -- protect sensible procedures from preemption
Steven reported:

|
| I'm getting:
|
| Pid: 3477, comm: perf Not tainted 2.6.34-rc6 #2727
| Call Trace:
|  [<ffffffff811c7565>] debug_smp_processor_id+0xd5/0xf0
|  [<ffffffff81019874>] p4_hw_config+0x2b/0x15c
|  [<ffffffff8107acbc>] ? trace_hardirqs_on_caller+0x12b/0x14f
|  [<ffffffff81019143>] hw_perf_event_init+0x468/0x7be
|  [<ffffffff810782fd>] ? debug_mutex_init+0x31/0x3c
|  [<ffffffff810c68b2>] T.850+0x273/0x42e
|  [<ffffffff810c6cab>] sys_perf_event_open+0x23e/0x3f1
|  [<ffffffff81009e6a>] ? sysret_check+0x2e/0x69
|  [<ffffffff81009e32>] system_call_fastpath+0x16/0x1b
|
| When running perf record in latest tip/perf/core
|

Due to the fact that p4 counters are shared between HT threads
we synthetically divide the whole set of counters into two
non-intersected subsets. And while we're "borrowing" counters
from these subsets we should not be preempted (well, strictly
speaking in p4_hw_config we just pre-set reference to the
subset which allow to save some cycles in schedule routine
if it happens on the same cpu). So use get_cpu/put_cpu pair.

Also p4_pmu_schedule_events should use smp_processor_id rather
than raw_ version. This allow us to catch up preemption issue
(if there will ever be).

Reported-by: Steven Rostedt <rostedt@goodmis.org>
Tested-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Lin Ming <ming.m.lin@intel.com>
LKML-Reference: <20100508112716.963478928@openvz.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2010-05-08 14:17:53 +02:00
..
cpufreq powernow-k8: Fix frequency reporting 2010-05-03 15:04:18 +02:00
mcheck include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
mtrr include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
.gitignore
addon_cpuid_features.c x86, cpu: Print AMD virtualization features in /proc/cpuinfo 2010-02-13 15:04:40 -08:00
amd.c x86, amd: Get multi-node CPU info from NodeId MSR instead of PCI config space 2009-12-16 15:06:23 -08:00
bugs_64.c x86/cpu: Clean up various files a bit 2009-07-11 11:24:09 +02:00
bugs.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
cmpxchg.c
common.c Merge branch 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2009-12-14 12:36:46 -08:00
cpu.h x86, cpu: mv display_cacheinfo -> cpu_detect_cache_sizes 2009-11-23 11:59:53 -08:00
cyrix.c x86, cpu: mv display_cacheinfo -> cpu_detect_cache_sizes 2009-11-23 11:59:53 -08:00
hypervisor.c x86: Move tsc_calibration to x86_init_ops 2009-08-31 09:35:47 +02:00
intel_cacheinfo.c Driver core: Constify struct sysfs_ops in struct kobj_type 2010-03-07 17:04:49 -08:00
intel.c Merge commit 'v2.6.34-rc6' into perf/core 2010-04-30 09:56:44 +02:00
Makefile x86: Remove "x86 CPU features in debugfs" (CONFIG_X86_CPU_DEBUG) 2010-01-23 18:27:47 -08:00
mkcapflags.pl
perf_event_amd.c perf, x86: Fix __initconst vs const 2010-04-02 19:52:05 +02:00
perf_event_intel_ds.c perf, x86: Improve the PEBS ABI 2010-05-07 11:31:02 +02:00
perf_event_intel_lbr.c perf, x86: Clean up debugctlmsr bit definitions 2010-03-26 09:41:03 +01:00
perf_event_intel.c perf, x86: Improve the PEBS ABI 2010-05-07 11:31:02 +02:00
perf_event_p4.c x86, perf: P4 PMU -- protect sensible procedures from preemption 2010-05-08 14:17:53 +02:00
perf_event_p6.c perf, x86: Fix __initconst vs const 2010-04-02 19:52:05 +02:00
perf_event.c perf, x86: implement group scheduling transactional APIs 2010-05-07 11:31:03 +02:00
perfctr-watchdog.c perf, x86: rename macro in ARCH_PERFMON_EVENTSEL_ENABLE 2010-03-01 14:21:23 +01:00
powerflags.c
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
sched.c sched: x86: Name old_perf in a unique way 2009-09-16 11:21:07 +02: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 VMware Balloon driver 2010-04-24 11:31:26 -07:00