Calculate context length outside of retry loop
[lttng-modules.git] / lib / ringbuffer / frontend_internal.h
index 32785853b721bb3a6d0aebedce45607bab8efb0b..26bd7c24fd64be6c196db641e2456bf3dd5dbde0 100644 (file)
@@ -150,7 +150,8 @@ int last_tsc_overflow(const struct lib_ring_buffer_config *config,
 #endif
 
 extern
-int lib_ring_buffer_reserve_slow(struct lib_ring_buffer_ctx *ctx);
+int lib_ring_buffer_reserve_slow(struct lib_ring_buffer_ctx *ctx,
+               void *client_ctx);
 
 extern
 void lib_ring_buffer_switch_slow(struct lib_ring_buffer *buf,
@@ -167,7 +168,6 @@ void lib_ring_buffer_check_deliver_slow(const struct lib_ring_buffer_config *con
 
 extern
 void lib_ring_buffer_switch_remote(struct lib_ring_buffer *buf);
-
 extern
 void lib_ring_buffer_switch_remote_empty(struct lib_ring_buffer *buf);
 
@@ -288,9 +288,9 @@ static inline
 void lib_ring_buffer_write_commit_counter(const struct lib_ring_buffer_config *config,
                                          struct lib_ring_buffer *buf,
                                          struct channel *chan,
-                                         unsigned long idx,
                                          unsigned long buf_offset,
-                                         unsigned long commit_count)
+                                         unsigned long commit_count,
+                                         struct commit_counters_hot *cc_hot)
 {
        unsigned long commit_seq_old;
 
@@ -306,10 +306,9 @@ void lib_ring_buffer_write_commit_counter(const struct lib_ring_buffer_config *c
        if (unlikely(subbuf_offset(buf_offset - commit_count, chan)))
                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);
+       commit_seq_old = v_read(config, &cc_hot->seq);
+       if (likely((long) (commit_seq_old - commit_count) < 0))
+               v_set(config, &cc_hot->seq, commit_count);
 }
 
 extern int lib_ring_buffer_create(struct lib_ring_buffer *buf,
This page took 0.033867 seconds and 4 git commands to generate.