Re: [PATCH] s390/pai: Handle CPU hotplug add for PAI PMU

[email protected]
Newsgroups org.kernel.vger.linux-s390
Message-ID <[email protected]>
> The command 'perf stat -e pai_crypto/CRYPTO_ALL/ -- <command>
> crashes the kernel when CPUs are hotplug added during that run.
> 
> Root cause is the allocation of struct pai_mapptr at first
> event initialization. The allocation is dynamic and the first
> event that has task context creates such a structure for
> each online CPU. This is not sufficient. CPUs may be offline
> during event creation and can be set online during the
> perf run time. For example commands
> 
>  # echo 0 > /sys/devices/system/cpu/cpu1/online
>  # perf stat -e pai_crypto/CRYPTO_ALL/ -i -- stress-ng -t10s --matrix X
>  # sleep 1
>  # echo 1 > /sys/devices/system/cpu/cpu1/online
> 
> [ ... ]
> possible CPUs, not just the ones currently online.
> 
> Fixes: 92ea686840ac ("s390/pai_crypto: Enable per-task counting event")
> Cc: <[email protected]> # v6.11+
> Signed-off-by: Thomas Richter <[email protected]>

Sashiko has reviewed this patch and found no issues. It looks great!

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.