android_kernel_motorola_sm6375/arch/powerpc
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Athira Rajeev 8d6937c1e0 powerpc/perf: Fix power9 event alternatives
[ Upstream commit 0dcad700bb2776e3886fe0a645a4bf13b1e747cd ]

When scheduling a group of events, there are constraint checks done to
make sure all events can go in a group. Example, one of the criteria is
that events in a group cannot use the same PMC. But platform specific
PMU supports alternative event for some of the event codes. During
perf_event_open(), if any event group doesn't match constraint check
criteria, further lookup is done to find alternative event.

By current design, the array of alternatives events in PMU code is
expected to be sorted by column 0. This is because in
find_alternative() the return criteria is based on event code
comparison. ie. "event < ev_alt[i][0])". This optimisation is there
since find_alternative() can be called multiple times. In power9 PMU
code, the alternative event array is not sorted properly and hence there
is breakage in finding alternative events.

To work with existing logic, fix the alternative event array to be
sorted by column 0 for power9-pmu.c

Results:

With alternative events, multiplexing can be avoided. That is, for
example, in power9 PM_LD_MISS_L1 (0x3e054) has alternative event,
PM_LD_MISS_L1_ALT (0x400f0). This is an identical event which can be
programmed in a different PMC.

Before:

 # perf stat -e r3e054,r300fc

 Performance counter stats for 'system wide':

           1057860      r3e054              (50.21%)
               379      r300fc              (49.79%)

       0.944329741 seconds time elapsed

Since both the events are using PMC3 in this case, they are
multiplexed here.

After:

 # perf stat -e r3e054,r300fc

 Performance counter stats for 'system wide':

           1006948      r3e054
               182      r300fc

Fixes: 91e0bd1e62 ("powerpc/perf: Add PM_LD_MISS_L1 and PM_BR_2PATH to power9 event list")
Signed-off-by: Athira Rajeev <[email protected]>
Reviewed-by: Madhavan Srinivasan <[email protected]>
Signed-off-by: Michael Ellerman <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Sasha Levin <[email protected]>
2022-04-27 13:50:49 +02:00
..
boot powerpc: dts: t104xrdb: fix phy type for FMAN 4/5 2022-04-15 14:18:32 +02:00
configs powerpc/config: Renable MTD_PHYSMAP_OF 2021-09-22 12:26:24 +02:00
crypto
include powerpc: Fix virt_addr_valid() for 64-bit Book3E & 32-bit 2022-04-20 09:19:37 +02:00
kernel powerpc: Set crashkernel offset to mid of RMA region 2022-04-15 14:18:32 +02:00
kvm KVM: PPC: Fix TCE handling for VFIO 2022-04-27 13:50:49 +02:00
lib powerpc/lib/sstep: Fix build errors with newer binutils 2022-04-15 14:18:25 +02:00
math-emu
mm powerpc/kasan: Fix early region not updated correctly 2022-04-15 14:18:29 +02:00
net powerpc/bpf: Emit stf barrier instruction sequences for BPF_NOSPEC 2021-11-17 09:48:49 +01:00
oprofile
perf powerpc/perf: Fix power9 event alternatives 2022-04-27 13:50:49 +02:00
platforms powerpc: Fix build errors with newer binutils 2022-04-15 14:18:25 +02:00
purgatory
sysdev powerpc/sysdev: fix incorrect use to determine if list is empty 2022-04-15 14:18:15 +02:00
tools
xmon
Kbuild
Kconfig powerpc: Fix HAVE_HARDLOCKUP_DETECTOR_ARCH build configuration 2021-05-14 09:44:26 +02:00
Kconfig.debug powerpc: iommu: fix build when neither PCI or IBMVIO is set 2021-05-14 09:44:28 +02:00
Makefile powerpc/Makefile: Don't pass -mcpu=powerpc64 when building 32-bit 2022-04-15 14:18:14 +02:00
Makefile.postlink