rcutorture: Make failure indication note reader-batch overflow
authorPaul E. McKenney <paulmck@kernel.org>
Fri, 20 May 2022 20:18:16 +0000 (13:18 -0700)
committerPaul E. McKenney <paulmck@kernel.org>
Tue, 21 Jun 2022 22:57:04 +0000 (15:57 -0700)
The loop scanning the pipesummary[] array currently skips the last
element, which means that the diagnostics ignore those rarest of
situations, namely where some readers persist across more than ten
grace periods, but all other readers avoid spanning a full grace period.
This commit therefore adjusts the scan to include the last element of
this array.

Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
kernel/rcu/rcutorture.c

index 62841e9cd2686d34555b8f96240b1cd2c84f3423..7e7c3518ab06fe4d48d866867ac66d75cce9ab8b 100644 (file)
@@ -1869,7 +1869,7 @@ rcu_torture_stats_print(void)
                        batchsummary[i] += READ_ONCE(per_cpu(rcu_torture_batch, cpu)[i]);
                }
        }
-       for (i = RCU_TORTURE_PIPE_LEN - 1; i >= 0; i--) {
+       for (i = RCU_TORTURE_PIPE_LEN; i >= 0; i--) {
                if (pipesummary[i] != 0)
                        break;
        }