Skip to content

Commit 0aa0e52

Browse files
committed
ring-buffer: Have rb_time_cmpxchg() set the msb counter too
The rb_time_cmpxchg() on 32-bit architectures requires setting three 32-bit words to represent the 64-bit timestamp, with some salt for synchronization. Those are: msb, top, and bottom The issue is, the rb_time_cmpxchg() did not properly salt the msb portion, and the msb that was written was stale. Link: https://lore.kernel.org/linux-trace-kernel/[email protected] Cc: [email protected] Cc: Masami Hiramatsu <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Mathieu Desnoyers <[email protected]> Fixes: f03f2ab ("ring-buffer: Have 32 bit time stamps use all 64 bits") Signed-off-by: Steven Rostedt (Google) <[email protected]>
1 parent dec8900 commit 0aa0e52

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

kernel/trace/ring_buffer.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -722,10 +722,12 @@ static bool rb_time_cmpxchg(rb_time_t *t, u64 expect, u64 set)
722722
cnt2 = cnt + 1;
723723

724724
rb_time_split(val, &top, &bottom, &msb);
725+
msb = rb_time_val_cnt(msb, cnt);
725726
top = rb_time_val_cnt(top, cnt);
726727
bottom = rb_time_val_cnt(bottom, cnt);
727728

728729
rb_time_split(set, &top2, &bottom2, &msb2);
730+
msb2 = rb_time_val_cnt(msb2, cnt);
729731
top2 = rb_time_val_cnt(top2, cnt2);
730732
bottom2 = rb_time_val_cnt(bottom2, cnt2);
731733

0 commit comments

Comments
 (0)