Message ID | 1553271844-49003-1-git-send-email-julien.thierry@arm.com (mailing list archive) |
---|---|
Headers | show |
Series | arm_pmu: Use NMI for perf interrupt | expand |
On Fri, Mar 22, 2019 at 04:23:55PM +0000, Julien Thierry wrote: > Hi, > > On arm64, perf reports that counter overflow very often (too often) > happen in function that potentially enabled interrutps: > > $ perf record -a -- sleep 60; perf report -F overhead,symbol > [...] > # Overhead Symbol > # ........ .......................................... > # > 6.58% [k] _raw_spin_unlock_irq > 6.10% [k] _raw_spin_unlock_irqrestore > 5.52% [k] ___bpf_prog_run > 4.37% [k] el0_svc_common > 2.58% [k] arch_cpu_idle > 2.39% [k] kmem_cache_alloc > 2.06% [k] __seccomp_filter > [...] > > The root issue is, if an overflow happens while executing with > interrupts disabled, the perf event will only be handled when interrupts > are reenabled (i.e. when the PMU interrupt is taken). The result being > the event being reported at the interrupt enabling location rather than > where the overflow actually happened. > > Now that we have support for pseudo-NMI on arm64 with GICv3, we can use > it to improve the profiling done using the PMU interrupt. > > With these changes, on the same machine, we get: > # Overhead Symbol > # ........ .................................. > # > 7.06% [k] ___bpf_prog_run > 4.08% [k] __update_load_avg_se > 4.02% [k] ktime_get_ts64 > 3.77% [k] __ll_sc_arch_atomic_add_return > 3.71% [k] file_ra_state_init > 3.62% [k] __ll_sc_arch_atomic64_sub > 3.53% [k] __ll_sc___cmpxchg_case_acq_32 > [...] > > _raw_spin_unlock_irq/irqrestore don't event appear anymore in the > perf trace. Very nice; I've little useful to say about the patches themselves, they appear ok, but this is not code I know well. But it is good to see perf becoming more useful on arm64.