summaryrefslogtreecommitdiff
path: root/tools/lib/python
diff options
context:
space:
mode:
authorSumanth Korikkar <sumanthk@linux.ibm.com>2026-10-06 13:13:03 +0200
committerHeiko Carstens <hca@linux.ibm.com>2026-10-09 15:50:08 +0200
commit99a95985dfc85eecad97f0991a2401d2fcef294c (patch)
treeb14efc9dd1b5dfa4124f7e3a7ceb164105c937d9 /tools/lib/python
parent833ee20e712bd0c71435feddaa7b578799fe50c6 (diff)
downloadlinux-next-99a95985dfc85eecad97f0991a2401d2fcef294c.tar.gz
linux-next-99a95985dfc85eecad97f0991a2401d2fcef294c.zip
s390/cpum_cf: Check session mask before cpu offline
cfset_offline_cpu() stops counter sets for every active session without checking whether the outgoing cpu belongs to the session mask. For example, run an hwctr session on cpu0 and a cpu bound perf event on cpu1: lshwc -l 9999 -i 5 0:b perf stat -C 1 -e cpum_cf/CPU_CYCLES/ sleep 120 chcpu -d 1 chcpu -e 1 Although the hwctr session does not include cpu1, cfset_offline_cpu() decrements its counter set reference count. The subsequent perf teardown decrements it again, causing it to underflow. The perf event keeps the percpu state alive across hotplug. When cpu1 comes online, the hwctr session is started there and the reference count moves from -1 to 0. Stopping the hwctr session then decrements it to -1 again, so the zero triggered counter set disable path is skipped. Check the session mask before stopping counter sets on the outgoing cpu. This prevents the unmatched decrement and the resulting reference count underflow. Fixes: a029a4eab39e ("s390/cpumf: Allow concurrent access for CPU Measurement Counter Facility") Reported-by: Christian Borntraeger <borntraeger@linux.ibm.com> Cc: stable@vger.kernel.org # v5.14+ Signed-off-by: Sumanth Korikkar <sumanthk@linux.ibm.com> Reviewed-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Diffstat (limited to 'tools/lib/python')
0 files changed, 0 insertions, 0 deletions