]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/perf: Fix usage of nest_imc_refc
authorMadhavan Srinivasan <maddy@linux.vnet.ibm.com>
Wed, 16 Aug 2017 16:21:34 +0000 (21:51 +0530)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 17 Aug 2017 11:56:36 +0000 (21:56 +1000)
commit610bc280521477231061432b7c309840b4ce45a3
tree42306fde9a5de9467b487118d6f8e0adb646179c
parent97dfd7e0c3d8873a1a6bc667ea2df623a9fd978e
powerpc/perf: Fix usage of nest_imc_refc

nest_imc_refc is a reference count struct, used to track number of
active perf sessions using the nest units.

Currently the code accesses nest_imc_refc using node_id, which is
incorrect, the array is indexed by node number. Meaning in the case of
sparse node ids we index off the end of the array.

Fix it to use get_nest_pmu_ref() which uses the existing per-cpu
variable local_nest_imc_refc.

Fixes: bdfa74aa443f0 ('powerpc/perf: Add nest IMC PMU support')
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Madhavan Srinivasan <maddy@linux.vnet.ibm.com>
[mpe: Tweak change log]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/perf/imc-pmu.c