linux/arch/x86/events/intel
Zhou Chengming 4e71de7986 perf/x86/intel: Handle exclusive threadid correctly on CPU hotplug
The CPU hotplug function intel_pmu_cpu_starting() sets
cpu_hw_events.excl_thread_id unconditionally to 1 when the shared exclusive
counters data structure is already availabe for the sibling thread.

This works during the boot process because the first sibling gets threadid
0 assigned and the second sibling which shares the data structure gets 1.

But when the first thread of the core is offlined and onlined again it
shares the data structure with the second thread and gets exclusive thread
id 1 assigned as well.

Prevent this by checking the threadid of the already online thread.

[ tglx: Rewrote changelog ]

Signed-off-by: Zhou Chengming <zhouchengming1@huawei.com>
Cc: NuoHan Qiao <qiaonuohan@huawei.com>
Cc: ak@linux.intel.com
Cc: peterz@infradead.org
Cc: kan.liang@intel.com
Cc: dave.hansen@linux.intel.com
Cc: eranian@google.com
Cc: qiaonuohan@huawei.com
Cc: davidcc@google.com
Cc: guohanjun@huawei.com
Link: http://lkml.kernel.org/r/1484536871-3131-1-git-send-email-zhouchengming1@huawei.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---					---
 arch/x86/events/intel/core.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
2017-01-17 11:08:36 +01:00
..
bts.c perf/x86/intel/bts: Make it an exclusive PMU 2016-09-22 14:56:08 +02:00
core.c perf/x86/intel: Handle exclusive threadid correctly on CPU hotplug 2017-01-17 11:08:36 +01:00
cqm.c cpu/hotplug: Cleanup state names 2016-12-25 10:47:44 +01:00
cstate.c perf/x86: Set pmu->module in Intel PMU modules 2017-01-05 09:13:55 +01:00
ds.c perf/x86/intel: Account interrupts for PEBS errors 2017-01-14 11:06:49 +01:00
knc.c perf/x86/intel: Fix PEBS warning by only restoring active PMU in pmi 2016-03-08 12:18:32 +01:00
lbr.c perf/x86/intel: Remove an inconsistent NULL check 2016-10-16 11:34:14 +02:00
Makefile x86/perf/intel/rapl: Fix module name collision with powercap intel-rapl 2016-07-06 12:51:59 +02:00
p4.c perf/x86/intel/p4: Trival indentation fix, remove space 2016-05-20 09:18:22 +02:00
p6.c perf/x86: Move perf_event.h to its new home 2016-02-17 10:11:36 +01:00
pt.c x86/cpuid: Cleanup cpuid_regs definitions 2016-11-16 11:13:09 +01:00
pt.h perf/x86/intel/pt: Add support for PTWRITE and power event tracing 2016-09-20 01:18:28 +02:00
rapl.c perf/x86: Set pmu->module in Intel PMU modules 2017-01-05 09:13:55 +01:00
uncore_nhmex.c perf/x86/intel/uncore: Clean up hardware on exit 2016-02-29 09:35:15 +01:00
uncore_snb.c perf/x86/uncore: Fix crash by removing bogus event_list[] handling for SNB client uncore IMC 2016-11-16 09:46:35 +01:00
uncore_snbep.c perf/x86/intel/uncore: Fix hardcoded socket 0 assumption in the Haswell init code 2017-01-11 12:13:21 +01:00
uncore.c perf/x86: Set pmu->module in Intel PMU modules 2017-01-05 09:13:55 +01:00
uncore.h perf/x86/intel/uncore: Add Skylake server uncore support 2016-09-10 11:18:52 +02:00