]> git.baikalelectronics.ru Git - kernel.git/commit
s390/cpum_sf: Fix wrong page count in error message
authorThomas Richter <tmricht@linux.ibm.com>
Mon, 23 Mar 2020 10:09:07 +0000 (11:09 +0100)
committerVasily Gorbik <gor@linux.ibm.com>
Wed, 25 Mar 2020 11:39:37 +0000 (12:39 +0100)
commitf522a771f39845cd9ba9d25bdfa62617f21fc287
treed542e1d52f0b059ddff18b621e8c8e3a7632ea3b
parent88472aaf0d0cf5af715e6f99c58ac8d1e28a5e46
s390/cpum_sf: Fix wrong page count in error message

When perf record -e SF_CYCLES_BASIC_DIAG runs with very high
frequency, the samples arrive faster than the perf process can
save them to file. Eventually, for longer running processes, this
leads to the siutation where the trace buffers allocated by perf
slowly fills up. At one point the auxiliary trace buffer is full
and  the CPU Measurement sampling facility is turned off. Furthermore
a warning is printed to the kernel log buffer:

cpum_sf: The AUX buffer with 0 pages for the diagnostic-sampling
mode is full

The number of allocated pages for the auxiliary trace buffer is shown
as zero pages. That is wrong.

Fix this by saving the number of allocated pages before entering the
work loop in the interrupt handler. When the interrupt handler processes
the samples, it may detect the buffer full condition and stop sampling,
reducing the buffer size to zero.
Print the correct value in the error message:

cpum_sf: The AUX buffer with 256 pages for the diagnostic-sampling
mode is full

Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
arch/s390/kernel/perf_cpum_sf.c