linux/arch
Thomas Richter 9d48c7afed s390/cpumf: cpum_cf PMU displays invalid value after hotplug remove
When a CPU is hotplugged while the perf stat -e cycles command is
running, a wrong (very large) value is displayed immediately after the
CPU removal:

  Check the values, shouldn't be too high as in
            time             counts unit events
     1.001101919           29261846      cycles
     2.002454499           17523405      cycles
     3.003659292           24361161      cycles
     4.004816983 18446744073638406144      cycles
     5.005671647      <not counted>      cycles
     ...

The CPU hotplug off took place after 3 seconds.
The issue is the read of the event count value after 4 seconds when
the CPU is not available and the read of the counter returns an
error. This is treated as a counter value of zero. This results
in a very large value (0 - previous_value).

Fix this by detecting the hotplugged off CPU and report 0 instead
of a very large number.

Cc: stable@vger.kernel.org
Fixes: a029a4eab3 ("s390/cpumf: Allow concurrent access for CPU Measurement Counter Facility")
Reported-by: Sumanth Korikkar <sumanthk@linux.ibm.com>
Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>
Reviewed-by: Sumanth Korikkar <sumanthk@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
2021-11-08 14:17:49 +01:00
..
alpha Merge branch 'akpm' (patches from Andrew) 2021-11-06 14:08:17 -07:00
arc Merge branch 'akpm' (patches from Andrew) 2021-11-06 14:08:17 -07:00
arm Merge branch 'akpm' (patches from Andrew) 2021-11-06 14:08:17 -07:00
arm64 Merge branch 'akpm' (patches from Andrew) 2021-11-06 14:08:17 -07:00
csky Devicetree updates for v5.16: 2021-11-02 22:22:13 -07:00
h8300 Scheduler updates: 2021-11-01 13:48:52 -07:00
hexagon sched: Add wrapper for get_wchan() to keep task blocked 2021-10-15 11:25:14 +02:00
ia64 Merge branch 'akpm' (patches from Andrew) 2021-11-06 14:08:17 -07:00
m68k Merge branch 'akpm' (patches from Andrew) 2021-11-06 14:08:17 -07:00
microblaze pci-v5.16-changes 2021-11-06 14:36:12 -07:00
mips pci-v5.16-changes 2021-11-06 14:36:12 -07:00
nds32 Tracing updates for 5.16: 2021-11-01 20:05:19 -07:00
nios2 Scheduler updates: 2021-11-01 13:48:52 -07:00
openrisc Devicetree updates for v5.16: 2021-11-02 22:22:13 -07:00
parisc parisc: move CPU field back into thread_info 2021-11-04 11:21:47 +01:00
powerpc pci-v5.16-changes 2021-11-06 14:36:12 -07:00
riscv Merge branch 'akpm' (patches from Andrew) 2021-11-06 14:08:17 -07:00
s390 s390/cpumf: cpum_cf PMU displays invalid value after hotplug remove 2021-11-08 14:17:49 +01:00
sh Merge branch 'akpm' (patches from Andrew) 2021-11-06 14:08:17 -07:00
sparc pci-v5.16-changes 2021-11-06 14:36:12 -07:00
um Merge branch 'akpm' (patches from Andrew) 2021-11-06 14:08:17 -07:00
x86 s390 updates for the 5.16 merge window 2021-11-06 14:48:06 -07:00
xtensa Core: 2021-11-02 06:20:58 -07:00
.gitignore
Kconfig Tracing updates for 5.16: 2021-11-01 20:05:19 -07:00