Skip to content

Commit

Permalink
rcutorture: Fix rcu_torture_one_read() pipe_count overflow comment
Browse files Browse the repository at this point in the history
[ Upstream commit 8b9b443 ]

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 <[email protected]>
Closes: https://lore.kernel.org/lkml/CAHk-=wi7rJ-eGq+xaxVfzFEgbL9tdf6Kc8Z89rCpfcQOKm74Tw@mail.gmail.com/
Signed-off-by: Paul E. McKenney <[email protected]>
Signed-off-by: Uladzislau Rezki (Sony) <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
(cherry picked from commit 48b0a8596f86794a17db6f6e46b9d5290d019c1c)
Signed-off-by: Vijayendra Suman <[email protected]>
  • Loading branch information
paulmckrcu authored and vijay-suman committed Aug 7, 2024
1 parent 977dc08 commit deff982
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion kernel/rcu/rcutorture.c
Original file line number Diff line number Diff line change
Expand Up @@ -1604,7 +1604,8 @@ static bool rcu_torture_one_read(struct torture_random_state *trsp, long myid)
preempt_disable();
pipe_count = READ_ONCE(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();
Expand Down

0 comments on commit deff982

Please sign in to comment.