]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: threads: Eliminate all_tgroups_mask.
authorOlivier Houchard <ohouchard@haproxy.com>
Fri, 9 Jan 2026 02:25:24 +0000 (03:25 +0100)
committerOlivier Houchard <ohouchard@haproxy.com>
Thu, 15 Jan 2026 02:46:57 +0000 (03:46 +0100)
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.

include/haproxy/thread.h
src/haproxy.c
src/thread.c

index 9d13ed9527490400e26080a09a774e966226bd28..cde5c6aa57dbedeef1bbd3b06f0c3ddde30e99d5 100644 (file)
@@ -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 */
index f67ddaaff5528acd9cd1379f7633c4a92bc89f42..4498367b334bae63b4db13fd42ad377566d3c2c4 100644 (file)
@@ -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);
index 279e4f0e48a532881ac8e7b47fd0e77ee2bd6f40..159d405067456294e569caa5a4bd588280686ad7 100644 (file)
@@ -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) {