Files
android_kernel_xiaomi_sm8450/include/linux
Jiri Olsa 475113d937 perf/x86/intel: Account interrupts for PEBS errors
It's possible to set up PEBS events to get only errors and not
any data, like on SNB-X (model 45) and IVB-EP (model 62)
via 2 perf commands running simultaneously:

    taskset -c 1 ./perf record -c 4 -e branches:pp -j any -C 10

This leads to a soft lock up, because the error path of the
intel_pmu_drain_pebs_nhm() does not account event->hw.interrupt
for error PEBS interrupts, so in case you're getting ONLY
errors you don't have a way to stop the event when it's over
the max_samples_per_tick limit:

  NMI watchdog: BUG: soft lockup - CPU#22 stuck for 22s! [perf_fuzzer:5816]
  ...
  RIP: 0010:[<ffffffff81159232>]  [<ffffffff81159232>] smp_call_function_single+0xe2/0x140
  ...
  Call Trace:
   ? trace_hardirqs_on_caller+0xf5/0x1b0
   ? perf_cgroup_attach+0x70/0x70
   perf_install_in_context+0x199/0x1b0
   ? ctx_resched+0x90/0x90
   SYSC_perf_event_open+0x641/0xf90
   SyS_perf_event_open+0x9/0x10
   do_syscall_64+0x6c/0x1f0
   entry_SYSCALL64_slow_path+0x25/0x25

Add perf_event_account_interrupt() which does the interrupt
and frequency checks and call it from intel_pmu_drain_pebs_nhm()'s
error path.

We keep the pending_kill and pending_wakeup logic only in the
__perf_event_overflow() path, because they make sense only if
there's any data to deliver.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Vince Weaver <vince@deater.net>
Cc: Vince Weaver <vincent.weaver@maine.edu>
Link: http://lkml.kernel.org/r/1482931866-6018-2-git-send-email-jolsa@kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2017-01-14 11:06:49 +01:00
..
2016-11-17 23:19:00 +01:00
2016-07-08 16:23:11 +02:00
2016-12-22 22:58:37 -05:00
2016-10-19 14:34:36 -04:00
2016-12-08 13:31:11 -05:00
2016-12-17 21:27:44 -05:00
2016-08-11 09:41:35 -06:00
2016-10-25 11:08:28 +08:00
2016-12-08 16:37:33 -08:00
2016-09-27 21:20:53 -04:00
2016-10-07 18:46:30 -07:00
2016-12-05 19:01:16 -05:00
2016-10-28 08:48:16 -06:00
2016-11-25 10:15:13 -08:00
2016-12-05 19:01:16 -05:00
2016-12-05 18:58:32 -05:00
2016-12-25 17:21:22 +01:00
2016-12-25 17:21:22 +01:00
2016-11-30 14:36:01 +11:00
2016-09-14 09:18:09 -06:00
2016-09-20 23:20:32 +02:00
2016-08-10 11:23:44 -04:00
2016-12-12 18:55:06 -08:00
2016-12-25 17:21:23 +01:00
2016-09-27 12:33:47 +02:00
2016-11-17 08:24:48 -07:00
2016-12-06 11:05:46 +01:00
2016-12-16 00:13:41 +02:00
2016-11-26 11:18:02 -08:00
2016-07-29 12:17:52 -07:00
2016-08-28 23:32:41 -04:00
2016-12-08 13:18:35 -05:00
2016-11-16 18:32:02 -05:00
2016-12-19 17:29:44 -05:00
2016-12-12 18:55:07 -08:00
2016-11-10 17:03:35 +01:00
2016-12-06 10:17:03 +02:00
2016-12-08 14:21:47 -05:00
2016-10-31 16:18:30 -04:00
2016-10-14 11:36:59 -07:00
2016-07-12 19:25:38 -07:00
2016-09-27 21:52:00 -04:00
2016-11-15 16:34:27 -08:00
2016-07-06 10:51:14 +01:00
2016-09-20 04:43:36 -04:00
2016-10-31 15:45:18 -07:00
2016-06-14 10:54:40 -07:00
2016-12-25 17:21:22 +01:00
2016-09-06 18:30:20 +02:00
2016-10-05 18:23:36 -04:00
2016-12-25 17:21:22 +01:00
2016-07-19 17:43:38 +03:00
2016-12-09 22:12:21 -05:00
2016-12-12 18:55:08 -08:00
2016-12-25 17:21:22 +01:00