summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorThomas Richter <tmricht@linux.ibm.com>2023-06-15 14:31:58 +0300
committerAlexander Gordeev <agordeev@linux.ibm.com>2023-06-22 15:37:30 +0300
commit9b9cf3c77e7e090b30657b3d2c288deb58dfb4f2 (patch)
treedbddd01f7f04b153f8ba8aa9051a0460abc019b0 /include
parentd0d3e218d50bc93282df7bded9193e6fc9ccda48 (diff)
downloadlinux-9b9cf3c77e7e090b30657b3d2c288deb58dfb4f2.tar.xz
s390/cpum_cf: rework PER_CPU_DEFINE of struct cpu_cf_events
Struct cpu_cf_events is a large data structure and is statically defined for each possible CPU. Rework this and replace it by dynamically allocated data structures created when a perf_event_open() system call is invoked or an access via character device /dev/hwctr takes place. It is replaced by an array of pointers to all possible CPUs and reference counting. The array of pointers is allocated when the first event is created. For each online CPU an event is installed on, a struct cpu_cf_events is allocated and a pointer to struct cpu_cf_events is stored in the array: CPU 0 1 2 3 ... N +---+---+---+---+---+---+ cpu_cf_root::cpucf--> | * | | | |...| | +-|-+---+---+---+---+---+ | | \|/ +-------------+ |cpu_cf_events| | | +-------------+ With this approach the large data structure is only allocated when an event is actually installed and used. Also implement proper reference counting for allocation and removal. During interrupt processing make sure the pointer to cpu_cf_events is valid. The interrupt handler is shared and might be called when no event is active. This requires checking for a valid pointer to struct cpu_cf_events. When the pointer to the per-cpu cpu_cf_events is NULL, simply return. Signed-off-by: Thomas Richter <tmricht@linux.ibm.com> Acked-by: Sumanth Korikkar <sumanthk@linux.ibm.com> Acked-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions