android_kernel_google_msm/kernel
Peter Zijlstra 467131dbaa perf: Tighten (and fix) the grouping condition
commit c3c87e770458aa004bd7ed3f29945ff436fd6511 upstream.

The fix from 9fc81d87420d ("perf: Fix events installation during
moving group") was incomplete in that it failed to recognise that
creating a group with events for different CPUs is semantically
broken -- they cannot be co-scheduled.

Furthermore, it leads to real breakage where, when we create an event
for CPU Y and then migrate it to form a group on CPU X, the code gets
confused where the counter is programmed -- triggered in practice
as well by me via the perf fuzzer.

Fix this by tightening the rules for creating groups. Only allow
grouping of counters that can be co-scheduled in the same context.
This means for the same task and/or the same cpu.

Fixes: 9fc81d87420d ("perf: Fix events installation during moving group")
Bug: 34515362
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: http://lkml.kernel.org/r/20150123125834.090683288@infradead.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Willy Tarreau <w@1wt.eu>
Change-Id: I72247f51388177f172845ccd4621debcd3158940
2017-03-15 21:06:11 -07:00
..
cpu idle: Implement a per-cpu idle-polling mode 2014-11-12 22:49:15 -08:00
debug This is the 3.10.73 stable release 2015-05-01 13:49:45 -07:00
events perf: Tighten (and fix) the grouping condition 2017-03-15 21:06:11 -07:00
gcov
irq irq: pm: Remove unused variable 2015-06-18 15:22:07 -07:00
power wakeup_reason: use vsnprintf instead of snprintf for vargs. 2015-08-06 17:37:35 +00:00
sched sched: fix task-priority when using SCHED_RESET_ON_FORK 2016-09-21 14:17:26 -07:00
time This is the 3.10.73 stable release 2015-05-01 13:49:45 -07:00
trace tracing: do not leak kernel addresses 2017-03-15 21:06:10 -07:00
.gitignore
acct.c
async.c
audit.c CAPABILITIES: remove undefined caps from all processes 2014-09-17 09:03:57 -07:00
audit.h audit: fix mq_open and mq_unlink to add the MQ root as a hidden parent audit_names record 2013-12-04 10:57:03 -08:00
audit_tree.c audit: keep inode pinned 2014-11-21 09:22:52 -08:00
audit_watch.c
auditfilter.c audit: Fix compilation issue 2013-09-10 22:37:36 -06:00
auditsc.c auditsc: audit_krule mask accesses need bounds checking 2014-06-16 13:42:53 -07:00
backtracetest.c
bounds.c
capability.c CAPABILITIES: remove undefined caps from all processes 2014-09-17 09:03:57 -07:00
cgroup.c cgroup: prefer %pK to %p 2016-09-17 15:24:09 +00:00
cgroup_freezer.c
compat.c
configs.c
context_tracking.c Merge branch 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2013-06-20 08:18:35 -10:00
cpu.c cpu: send KOBJ_ONLINE event when enabling cpus 2016-06-14 17:56:44 -07:00
cpu_pm.c cpu_pm: Add level to the cluster pm notification 2015-01-07 22:31:58 -08:00
cpuset.c kernel: cpuset: Make cpusets restore on hotplug 2015-06-19 20:29:32 +00:00
crash_dump.c
cred.c
delayacct.c
dma.c
elfcore.c
exec_domain.c
exit.c Revert "android/lowmemorykiller: Ignore tasks with freed mm" 2015-12-30 10:33:33 -08:00
extable.c
fork.c Introducing per-task/per-process cpufreq statistics. 2016-03-03 13:50:04 -08:00
freezer.c This is the 3.10.67 stable release 2015-05-01 13:34:57 -07:00
futex.c Merge upstream tag 'v3.10.49' into msm-3.10 2014-08-20 13:23:09 -07:00
futex_compat.c
groups.c userns: Don't allow setgroups until a gid mapping has been setablished 2015-01-08 09:58:16 -08:00
hrtimer.c hrtimer: Prevent stale expiry time in hrtimer_interrupt() 2015-02-13 04:20:48 -08:00
hung_task.c
irq_work.c irq_work: register irq_work_cpu_notify in early init 2014-12-22 14:30:12 +05:30
itimer.c
jump_label.c
kallsyms.c
kcmp.c kcmp: fix standard comparison bug 2014-10-05 14:54:13 -07:00
Kconfig.freezer
Kconfig.hz kernel: remove CONFIG_USE_GENERIC_SMP_HELPERS 2014-02-07 15:55:40 -08:00
Kconfig.locks printk: Make the console flush configurable in hotplug path 2014-11-18 19:16:25 -07:00
Kconfig.preempt
kexec.c PCI: Disable Bus Master only on kexec reboot 2013-12-20 07:45:08 -08:00
kmod.c arch: Mass conversion of smp_mb__*() 2014-08-15 11:45:28 -07:00
kprobes.c
ksysfs.c
kthread.c kthread: Fix the race condition when kthread is parked 2015-06-16 18:19:35 -07:00
latencytop.c
lglock.c
lockdep.c lockdep: remove task argument from debug_check_no_locks_held 2013-07-01 15:38:03 -07:00
lockdep_internals.h
lockdep_proc.c
lockdep_states.h
Makefile UPSTREAM: KEYS: Separate the kernel signature checking keyring from module signing 2016-03-02 10:26:42 -08:00
modsign_pubkey.c
module-internal.h UPSTREAM: KEYS: Separate the kernel signature checking keyring from module signing 2016-03-02 10:26:42 -08:00
module.c This is the 3.10.67 stable release 2015-05-01 13:34:57 -07:00
module_signing.c UPSTREAM: KEYS: Separate the kernel signature checking keyring from module signing 2016-03-02 10:26:42 -08:00
mutex-debug.c
mutex-debug.h
mutex.c mutex: Add a delay into the SPIN_ON_OWNER wait loop. 2015-08-11 23:01:35 +00:00
mutex.h
notifier.c
nsproxy.c
padata.c
panic.c panic: resume console if panic after console suspend. 2015-09-14 10:22:45 -07:00
params.c
pid.c This is the 3.10.67 stable release 2015-05-01 13:34:57 -07:00
pid_namespace.c pid_namespace: pidns_get() should check task_active_pid_ns() != NULL 2014-04-26 17:15:34 -07:00
posix-cpu-timers.c
posix-timers.c posix-timers: Fix stack info leak in timer_create() 2014-11-14 08:48:00 -08:00
printk.c panic: resume console if panic after console suspend. 2015-09-14 10:22:45 -07:00
profile.c profile: Fix CPU hotplug callback registration 2014-07-01 13:52:28 -07:00
ptrace.c __ptrace_may_access() should not deny sub-threads 2016-02-04 08:04:22 -08:00
range.c range: Do not add new blank slot with add_range_with_merge 2013-06-18 11:32:10 -05:00
rcu.h
rcupdate.c
rcutiny.c
rcutiny_plugin.h
rcutorture.c
rcutree.c Revert "rcu: Make RCU_FAST_NO_HZ take advantage of numbered callbacks" 2015-09-09 10:40:34 -07:00
rcutree.h Revert "rcu: Make RCU_FAST_NO_HZ take advantage of numbered callbacks" 2015-09-09 10:40:34 -07:00
rcutree_plugin.h Revert "rcu: Make RCU_FAST_NO_HZ take advantage of numbered callbacks" 2015-09-09 10:40:34 -07:00
rcutree_trace.c Revert "rcu: Make RCU_FAST_NO_HZ take advantage of numbered callbacks" 2015-09-09 10:40:34 -07:00
relay.c
res_counter.c
resource.c kernel: Restrict permissions of /proc/iomem. 2015-02-09 16:17:30 -08:00
rtmutex-debug.c
rtmutex-debug.h rtmutex: Handle deadlock detection smarter 2014-07-17 15:58:04 -07:00
rtmutex-tester.c
rtmutex.c rtmutex: Plug slow unlock race 2014-07-17 15:58:04 -07:00
rtmutex.h rtmutex: Handle deadlock detection smarter 2014-07-17 15:58:04 -07:00
rtmutex_common.h
rwsem.c
seccomp.c seccomp,x86,arm,mips,s390: Remove nr parameter from secure_computing 2015-07-08 21:05:50 -07:00
semaphore.c
signal.c constify copy_siginfo_to_user{,32}() 2014-02-07 15:55:38 -08:00
smp.c This is the 3.10.67 stable release 2015-05-01 13:34:57 -07:00
smpboot.c smpboot: Add missing get_online_cpus() in smpboot_register_percpu_thread() 2015-02-11 14:48:17 +08:00
smpboot.h
softirq.c UPSTREAM: sched: Introduce preempt_count accessor functions 2016-07-22 15:44:15 -07:00
spinlock.c
srcu.c
stacktrace.c debugging: keep track of page owners 2014-03-28 13:33:08 -07:00
stop_machine.c
sys.c sched: move no_new_privs into new atomic flags 2015-07-08 21:05:42 -07:00
sys_ni.c seccomp: add "seccomp" syscall 2015-07-08 21:05:41 -07:00
sysctl.c FROMLIST: mm: mmap: Add new /proc tunable for mmap_base ASLR. 2016-01-14 11:58:47 -08:00
sysctl_binary.c sysctl: add cold_boot sysctl entry 2013-09-05 14:51:16 -07:00
system_certificates.S UPSTREAM: KEYS: Separate the kernel signature checking keyring from module signing 2016-03-02 10:26:42 -08:00
system_keyring.c UPSTREAM: KEYS: Separate the kernel signature checking keyring from module signing 2016-03-02 10:26:42 -08:00
task_work.c
taskstats.c
test_kprobes.c
time.c time: settimeofday: Validate the values of tv from user 2015-01-29 17:40:56 -08:00
timeconst.bc
timer.c UPSTREAM: sched: Introduce preempt_count accessor functions 2016-07-22 15:44:15 -07:00
tracepoint.c tracepoint: Do not waste memory on mods with no tracepoints 2014-05-30 21:52:11 -07:00
tsacct.c
uid16.c groups: Consolidate the setgroups permission checks 2015-01-08 09:58:16 -08:00
up.c
user-return-notifier.c
user.c userns: Add a knob to disable setgroups on a per user namespace basis 2015-01-08 09:58:16 -08:00
user_namespace.c userns: Allow setting gid_maps without privilege when setgroups is disabled 2015-01-08 09:58:17 -08:00
utsname.c
utsname_sysctl.c
wait.c sched: add bit_wait_io for 3.18 ext4 backport 2015-06-11 16:54:34 -04:00
watchdog.c hardlockup: detect hard lockups without NMIs using secondary cpus 2013-07-01 14:16:17 -07:00
workqueue.c This is the 3.10.73 stable release 2015-05-01 13:49:45 -07:00
workqueue_internal.h