Skip to content

Commit 730c3ed

Browse files
paulmckrcuFrederic Weisbecker
authored andcommitted
refscale: Fix misplaced data re-read
This commit fixes a misplaced data re-read in the typesafe code. The reason that this was not noticed is that this is a performance test with no writers, so a mismatch could not occur. Signed-off-by: Paul E. McKenney <paulmck@kernel.org> Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
1 parent 0bb80ec commit 730c3ed

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/rcu/refscale.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -655,12 +655,12 @@ static void typesafe_delay_section(const int nloops, const int udl, const int nd
655655
goto retry;
656656
}
657657
un_delay(udl, ndl);
658+
b = READ_ONCE(rtsp->a);
658659
// Remember, seqlock read-side release can fail.
659660
if (!rts_release(rtsp, start)) {
660661
rcu_read_unlock();
661662
goto retry;
662663
}
663-
b = READ_ONCE(rtsp->a);
664664
WARN_ONCE(a != b, "Re-read of ->a changed from %u to %u.\n", a, b);
665665
b = rtsp->b;
666666
rcu_read_unlock();

0 commit comments

Comments
 (0)