diff options
author | Thomas Richter <tmricht@linux.ibm.com> | 2019-11-15 14:50:46 +0300 |
---|---|---|
committer | Vasily Gorbik <gor@linux.ibm.com> | 2019-11-20 19:16:01 +0300 |
commit | 6a82e23f45fe0aa821e7a935e39d0acb20c275c0 (patch) | |
tree | 202969208c75efad61623325e2521125c18a167d /arch/x86/mm/mem_encrypt.c | |
parent | 72a81ad9d6d62dcb79f7e8ad66ffd1c768b72026 (diff) | |
download | linux-6a82e23f45fe0aa821e7a935e39d0acb20c275c0.tar.xz |
s390/cpumf: Adjust registration of s390 PMU device drivers
Linux-next commit titled "perf/core: Optimize perf_init_event()"
changed the semantics of PMU device driver registration.
It was done to speed up the lookup/handling of PMU device driver
specific events. It also enforces that only one PMU device
driver will be registered of type PERF_EVENT_RAW.
This change added these line in function perf_pmu_register():
...
+ ret = idr_alloc(&pmu_idr, pmu, max, 0, GFP_KERNEL);
+ if (ret < 0)
goto free_pdc;
+
+ WARN_ON(type >= 0 && ret != type);
The warn_on generates a message. We have 3 PMU device drivers,
each registered as type PERF_TYPE_RAW.
The cf_diag device driver (arch/s390/kernel/perf_cpumf_cf_diag.c)
always hits the WARN_ON because it is the second PMU device driver
(after sampling device driver arch/s390/kernel/perf_cpumf_sf.c)
which is registered as type 4 (PERF_TYPE_RAW).
So when the sampling device driver is registered, ret has value 4.
When cf_diag device driver is registered with type 4,
ret has value of 5 and WARN_ON fires.
Adjust the PMU device drivers for s390 to support the new
semantics required by perf_pmu_register().
Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Diffstat (limited to 'arch/x86/mm/mem_encrypt.c')
0 files changed, 0 insertions, 0 deletions