android_kernel_samsung_msm8976/arch/arc
Vineet Gupta 677eea664a ARC: dw2 unwind: Remove falllback linear search thru FDE entries
commit 2e22502c080f27afeab5e6f11e618fb7bc7aea53 upstream.

Fixes STAR 9000953410: "perf callgraph profiling causing RCU stalls"

| perf record -g -c 15000 -e cycles /sbin/hackbench
|
| INFO: rcu_preempt self-detected stall on CPU
| 1: (1 GPs behind) idle=609/140000000000002/0 softirq=2914/2915 fqs=603
| Task dump for CPU 1:

in-kernel dwarf unwinder has a fast binary lookup and a fallback linear
search (which iterates thru each of ~11K entries) thus takes 2 orders of
magnitude longer (~3 million cycles vs. 2000). Routines written in hand
assembler lack dwarf info (as we don't support assembler CFI pseudo-ops
yet) fail the unwinder binary lookup, hit linear search, failing
nevertheless in the end.

However the linear search is pointless as binary lookup tables are created
from it in first place. It is impossible to have binary lookup fail while
succeed the linear search. It is pure waste of cycles thus removed by
this patch.

This manifested as RCU stalls / NMI watchdog splat when running
hackbench under perf with callgraph profiling. The triggering condition
was perf counter overflowing in routine lacking dwarf info (like memset)
leading to patheic 3 million cycle unwinder slow path and by the time it
returned new interrupts were already pending (Timer, IPI) and taken
rightaway. The original memset didn't make forward progress, system kept
accruing more interrupts and more unwinder delayes in a vicious feedback
loop, ultimately triggering the NMI diagnostic.

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-03 15:06:21 -08:00
..
boot ARC: [nsimosci] move peripherals to match model to FPGA 2015-01-27 07:52:31 -08:00
configs ARC: [nsimosci] Unbork console 2014-04-14 06:42:19 -07:00
include ARC: make sure instruction_pointer() returns unsigned value 2015-08-10 12:20:30 -07:00
kernel ARC: dw2 unwind: Remove falllback linear search thru FDE entries 2016-03-03 15:06:21 -08:00
lib ARC: [lib] strchr breakage in Big-endian configuration 2013-08-29 09:47:34 -07:00
mm arc: mm: Fix build failure 2015-04-29 10:34:01 +02:00
oprofile ARC: OProfile support 2013-02-15 23:16:00 +05:30
plat-arcfpga ARC port updates for Linux 3.10 (part 1) 2013-05-09 14:36:27 -07:00
plat-tb10x ARC: [TB10x] Remove redundant abilis,simple-pinctrl mechanism 2013-05-15 10:12:03 +05:30
Kbuild
Kconfig ARC: [mm] Aliasing VIPT dcache support 2/4 2013-05-09 21:59:46 +05:30
Kconfig.debug
Makefile ARC: [TB10x] Add support for TB10x platform 2013-05-07 13:43:59 +05:30