s390/cpumf: Allow multiple processes to access /dev/hwc
authorThomas Richter <tmricht@linux.ibm.com>
Mon, 27 Sep 2021 13:01:56 +0000 (15:01 +0200)
committerVasily Gorbik <gor@linux.ibm.com>
Tue, 26 Oct 2021 13:21:29 +0000 (15:21 +0200)
commit453380318edd523bc08bf4892d354b49cb85bb0b
treea2f7c064c8168f4bc69491fb364103d170435c12
parentff7a1eefdff5867db4a4f678deed0d04f32cad15
s390/cpumf: Allow multiple processes to access /dev/hwc

Commit a029a4eab39e ("s390/cpumf: Allow concurrent access for CPU Measurement Counter Facility")
added CPU Measurement counter facility access to multiple consumers.
It allows concurrent access to the CPU Measurement counter facility
via several perf_event_open() system call invocations and via ioctl()
system call of device /dev/hwc.  However the access via device /dev/hwc
was exclusive, only one process was able to open this device.

The patch removes this restriction. Now multiple invocations of lshwc
can execute in parallel. They can access different CPUs and counter
sets or CPUs and counter set can overlap.

Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>
Suggested-by: Heiko Carstens <hca@linux.ibm.com>
Reviewed-by: Sumanth Korikkar <sumanthk@linux.ibm.com>
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
arch/s390/kernel/perf_cpum_cf.c