Performance: Relax atomicity constraints for crash handling
[lttng-modules.git] / lib / ringbuffer / frontend_internal.h
index 32785853b721bb3a6d0aebedce45607bab8efb0b..a2efee79a2f7f1ddcbc9ab31f5a7516ff5704cc0 100644 (file)
@@ -307,9 +307,8 @@ void lib_ring_buffer_write_commit_counter(const struct lib_ring_buffer_config *c
                return;
 
        commit_seq_old = v_read(config, &buf->commit_hot[idx].seq);
-       while ((long) (commit_seq_old - commit_count) < 0)
-               commit_seq_old = v_cmpxchg(config, &buf->commit_hot[idx].seq,
-                                          commit_seq_old, commit_count);
+       if (likely((long) (commit_seq_old - commit_count) < 0))
+               v_set(config, &buf->commit_hot[idx].seq, commit_count);
 }
 
 extern int lib_ring_buffer_create(struct lib_ring_buffer *buf,
This page took 0.025755 seconds and 4 git commands to generate.