Fix: populate possible cpus array len cache with fd tracker lock 2.13-custom-upgrade-rev3
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 10 Oct 2022 15:53:50 +0000 (16:53 +0100)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 10 Oct 2022 15:57:20 +0000 (16:57 +0100)
get_possible_cpus_array_len internally opens and closes file
descriptors. Initialize the cache with fd tracker lock held to prevent
concurrent use of close/closeall/closefrom.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: Ib16c73f11af0b0cb163b38b0b096a86f6ae86325

src/lib/lttng-ust/lttng-ust-comm.c

index adb159a35e11e550d8611174b9cc0a32c2d0998e..90abc71f3e4d9e4a85193393ac4e4a090d15d887 100644 (file)
@@ -44,6 +44,7 @@
 #include "lib/lttng-ust/futex.h"
 #include "common/ustcomm.h"
 #include "common/ust-fd.h"
+#include "common/smp.h"
 #include "common/logging.h"
 #include "common/macros.h"
 #include "common/tracepoint.h"
@@ -2244,6 +2245,13 @@ void lttng_ust_ctor(void)
 
        lttng_ust_tp_init();
        lttng_ust_statedump_init();
+       /*
+        * Populate possible cpus array len cache with the fd tracker
+        * lock held.
+        */
+       lttng_ust_lock_fd_tracker();
+       (void) get_possible_cpus_array_len();
+       lttng_ust_unlock_fd_tracker();
        lttng_ust_ring_buffer_clients_init();
        lttng_ust_counter_clients_init();
        lttng_perf_counter_init();
This page took 0.032182 seconds and 5 git commands to generate.