From 6ba4680b5bfaa652e84f15c479e49f483c530c42 Mon Sep 17 00:00:00 2001 From: Nikita Danilov Date: Fri, 10 Apr 2026 14:19:48 -0700 Subject: [PATCH] eal_common_options.c:verify_perms(): remove per-thread object. verify_perms() defines a 4KB TLS array last_dir_checked to avoid re-checking permissions on the same directory again. This array is added to the TLS of every thread in the process. This wastes memory (a bit, arguably) and makes it impossible to use fast 'initial-exec' tls model in shared libraries linked with spdk/dpdk. Fix: simply drop '__thread' qualifier, the code is only ever executed during single-threaded initialisation: rte_eal_init() -> eal_plugins_init() -> eal_dlopen() -> verify_perms(). Signed-off-by: Nikita Danilov --- lib/eal/common/eal_common_options.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/eal/common/eal_common_options.c b/lib/eal/common/eal_common_options.c index ff5861b5f3..94ca8941a5 100644 --- a/lib/eal/common/eal_common_options.c +++ b/lib/eal/common/eal_common_options.c @@ -431,7 +431,7 @@ verify_perms(const char *dirpath) /* if not root, check down one level first */ if (strcmp(dirpath, "/") != 0) { - static __thread char last_dir_checked[PATH_MAX]; + static char last_dir_checked[PATH_MAX] = {}; char copy[PATH_MAX]; const char *dir;