From: Willy Tarreau Date: Mon, 27 Jun 2022 14:22:22 +0000 (+0200) Subject: MINOR: clock: use ltid_bit in clock_report_idle() X-Git-Tag: v2.7-dev2~125 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1e7f0d68b0b5f231260b6c766a64851fd4d73f90;p=thirdparty%2Fhaproxy.git MINOR: clock: use ltid_bit in clock_report_idle() Since commit cc7a11ee3 ("MINOR: threads: set the tid, ltid and their bit in thread_cfg") we ought not use (1UL << thr) to get the group mask for thread , but (ha_thread_info[thr].ltid_bit). clock_report_idle() needs this. This also implies not using all_threads_mask anymore but taking the mask from the tgroup since it becomes relative now. --- diff --git a/src/clock.c b/src/clock.c index 3b9e9ff64a..099057f7df 100644 --- a/src/clock.c +++ b/src/clock.c @@ -276,7 +276,8 @@ uint clock_report_idle(void) uint thr; for (thr = 0; thr < MAX_THREADS; thr++) { - if (!(all_threads_mask & (1UL << thr))) + if (!ha_thread_info[thr].tg || + !(ha_thread_info[thr].tg->threads_enabled & ha_thread_info[thr].ltid_bit)) continue; total += HA_ATOMIC_LOAD(&ha_thread_ctx[thr].idle_pct); rthr++;