]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
rcutorture: Fix rcu_torture_one_read() pipe_count overflow comment
authorPaul E. McKenney <paulmck@kernel.org>
Thu, 7 Mar 2024 03:21:47 +0000 (19:21 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 5 Jul 2024 07:08:20 +0000 (09:08 +0200)
[ Upstream commit 8b9b443fa860276822b25057cb3ff3b28734dec0 ]

The "pipe_count > RCU_TORTURE_PIPE_LEN" check has a comment saying "Should
not happen, but...".  This is only true when testing an RCU whose grace
periods are always long enough.  This commit therefore fixes this comment.

Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
Closes: https://lore.kernel.org/lkml/CAHk-=wi7rJ-eGq+xaxVfzFEgbL9tdf6Kc8Z89rCpfcQOKm74Tw@mail.gmail.com/
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Uladzislau Rezki (Sony) <urezki@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
kernel/rcu/rcutorture.c

index 3c9feca1eab17e231750afd27606c557799ddc38..aef4d01c4f61e3b853c0e52adba26cef7c5c17d6 100644 (file)
@@ -1291,7 +1291,8 @@ static bool rcu_torture_one_read(struct torture_random_state *trsp)
        preempt_disable();
        pipe_count = p->rtort_pipe_count;
        if (pipe_count > RCU_TORTURE_PIPE_LEN) {
-               /* Should not happen, but... */
+               // Should not happen in a correct RCU implementation,
+               // happens quite often for torture_type=busted.
                pipe_count = RCU_TORTURE_PIPE_LEN;
        }
        completed = cur_ops->get_gp_seq();