From: Olivier Houchard Date: Fri, 9 Jan 2026 02:25:24 +0000 (+0100) Subject: MINOR: threads: Eliminate all_tgroups_mask. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1397982599433f48a2c0e501c893688f7f017241;p=thirdparty%2Fhaproxy.git MINOR: threads: Eliminate all_tgroups_mask. Now that it is unused, eliminate all_tgroups_mask, as we can't 64bits masks to represent thread groups, if we want to be able to have more than 64 thread groups. --- diff --git a/include/haproxy/thread.h b/include/haproxy/thread.h index 9d13ed952..cde5c6aa5 100644 --- a/include/haproxy/thread.h +++ b/include/haproxy/thread.h @@ -60,7 +60,6 @@ extern int thread_cpus_enabled_at_boot; /* Only way found to replace variables with constants that are optimized away * at build time. */ -enum { all_tgroups_mask = 1UL }; enum { tid_bit = 1UL }; enum { tid = 0 }; enum { tgid = 1 }; @@ -208,7 +207,6 @@ void wait_for_threads_completion(); void set_thread_cpu_affinity(); unsigned long long ha_get_pthread_id(unsigned int thr); -extern volatile unsigned long all_tgroups_mask; extern volatile unsigned int rdv_requests; extern volatile unsigned int isolated_thread; extern THREAD_LOCAL unsigned int tid; /* The thread id */ diff --git a/src/haproxy.c b/src/haproxy.c index f67ddaaff..4498367b3 100644 --- a/src/haproxy.c +++ b/src/haproxy.c @@ -3127,8 +3127,7 @@ void *run_thread_poll_loop(void *data) ptff->fct(); #ifdef USE_THREAD - if (!_HA_ATOMIC_AND_FETCH(&ha_tgroup_info[ti->tgid-1].threads_enabled, ~ti->ltid_bit)) - _HA_ATOMIC_AND(&all_tgroups_mask, ~tg->tgid_bit); + _HA_ATOMIC_AND(&ha_tgroup_info[ti->tgid-1].threads_enabled, ~ti->ltid_bit); _HA_ATOMIC_AND_FETCH(&tg_ctx->stopping_threads, ~ti->ltid_bit); if (tid > 0) pthread_exit(NULL); diff --git a/src/thread.c b/src/thread.c index 279e4f0e4..159d40506 100644 --- a/src/thread.c +++ b/src/thread.c @@ -60,7 +60,6 @@ THREAD_LOCAL struct thread_ctx *th_ctx = &ha_thread_ctx[0]; #ifdef USE_THREAD -volatile unsigned long all_tgroups_mask __read_mostly = 1; // nbtgroup 1 assumed by default volatile unsigned int rdv_requests = 0; // total number of threads requesting RDV volatile unsigned int isolated_thread = ~0; // ID of the isolated thread, or ~0 when none THREAD_LOCAL unsigned int tgid = 1; // thread ID starts at 1 @@ -1495,9 +1494,6 @@ int thread_map_to_groups() } -#ifdef USE_THREAD - all_tgroups_mask = m; -#endif #if defined(USE_THREAD) && defined(USE_CPU_AFFINITY) if (global.tune.debug & GDBG_CPU_AFFINITY) {