X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=lib%2Fringbuffer%2Fring_buffer_frontend.c;h=7993633c5bd4a38789d47af280e63defae824a4c;hb=4a6ea683a440dc224dc4a9628ff4f713c42f5922;hp=9121088f3ac7be9e5d84367675dd456ea656b7db;hpb=69a619a93c6a8082ac198debaf5ea44621290211;p=lttng-modules.git diff --git a/lib/ringbuffer/ring_buffer_frontend.c b/lib/ringbuffer/ring_buffer_frontend.c index 9121088f..7993633c 100644 --- a/lib/ringbuffer/ring_buffer_frontend.c +++ b/lib/ringbuffer/ring_buffer_frontend.c @@ -48,6 +48,7 @@ #include #include #include +#include #include #include #include @@ -708,7 +709,7 @@ static void channel_unregister_notifiers(struct channel *chan) int cpu; #ifdef CONFIG_HOTPLUG_CPU - get_online_cpus(); + lttng_cpus_read_lock(); chan->cpu_hp_enable = 0; for_each_online_cpu(cpu) { struct lib_ring_buffer *buf = per_cpu_ptr(chan->backend.buf, @@ -716,7 +717,7 @@ static void channel_unregister_notifiers(struct channel *chan) lib_ring_buffer_stop_switch_timer(buf); lib_ring_buffer_stop_read_timer(buf); } - put_online_cpus(); + lttng_cpus_read_unlock(); unregister_cpu_notifier(&chan->cpu_hp_notifier); #else for_each_possible_cpu(cpu) { @@ -756,14 +757,14 @@ void lib_ring_buffer_set_quiescent_channel(struct channel *chan) const struct lib_ring_buffer_config *config = &chan->backend.config; if (config->alloc == RING_BUFFER_ALLOC_PER_CPU) { - get_online_cpus(); + lttng_cpus_read_lock(); for_each_channel_cpu(cpu, chan) { struct lib_ring_buffer *buf = per_cpu_ptr(chan->backend.buf, cpu); lib_ring_buffer_set_quiescent(buf); } - put_online_cpus(); + lttng_cpus_read_unlock(); } else { struct lib_ring_buffer *buf = chan->backend.buf; @@ -778,14 +779,14 @@ void lib_ring_buffer_clear_quiescent_channel(struct channel *chan) const struct lib_ring_buffer_config *config = &chan->backend.config; if (config->alloc == RING_BUFFER_ALLOC_PER_CPU) { - get_online_cpus(); + lttng_cpus_read_lock(); for_each_channel_cpu(cpu, chan) { struct lib_ring_buffer *buf = per_cpu_ptr(chan->backend.buf, cpu); lib_ring_buffer_clear_quiescent(buf); } - put_online_cpus(); + lttng_cpus_read_unlock(); } else { struct lib_ring_buffer *buf = chan->backend.buf; @@ -882,7 +883,7 @@ struct channel *channel_create(const struct lib_ring_buffer_config *config, chan->cpu_hp_notifier.priority = 6; register_cpu_notifier(&chan->cpu_hp_notifier); - get_online_cpus(); + lttng_cpus_read_lock(); for_each_online_cpu(cpu) { struct lib_ring_buffer *buf = per_cpu_ptr(chan->backend.buf, cpu); @@ -892,7 +893,7 @@ struct channel *channel_create(const struct lib_ring_buffer_config *config, spin_unlock(&per_cpu(ring_buffer_nohz_lock, cpu)); } chan->cpu_hp_enable = 1; - put_online_cpus(); + lttng_cpus_read_unlock(); #else for_each_possible_cpu(cpu) { struct lib_ring_buffer *buf = per_cpu_ptr(chan->backend.buf,