From: Mathieu Desnoyers Date: Thu, 8 Nov 2018 17:42:29 +0000 (-0500) Subject: Clarify lib_ring_buffer_switch_slow() requirements X-Git-Tag: v2.10.3~2 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=0a722bbae004bff82b6f057e3660259de132d15e;p=lttng-ust.git Clarify lib_ring_buffer_switch_slow() requirements Signed-off-by: Mathieu Desnoyers --- diff --git a/libringbuffer/ring_buffer_frontend.c b/libringbuffer/ring_buffer_frontend.c index 6ca57b50..7b9dde5b 100644 --- a/libringbuffer/ring_buffer_frontend.c +++ b/libringbuffer/ring_buffer_frontend.c @@ -1996,9 +1996,11 @@ int lib_ring_buffer_try_switch_slow(enum switch_mode mode, * Force a sub-buffer switch. This operation is completely reentrant : can be * called while tracing is active with absolutely no lock held. * - * Note, however, that as a v_cmpxchg is used for some atomic - * operations, this function must be called from the CPU which owns the buffer - * for a ACTIVE flush. + * For RING_BUFFER_SYNC_PER_CPU ring buffers, as a v_cmpxchg is used for + * some atomic operations, this function must be called from the CPU + * which owns the buffer for a ACTIVE flush. However, for + * RING_BUFFER_SYNC_GLOBAL ring buffers, this function can be called + * from any CPU. */ void lib_ring_buffer_switch_slow(struct lttng_ust_lib_ring_buffer *buf, enum switch_mode mode, struct lttng_ust_shm_handle *handle)