diff --git a/include/haproxy/receiver-t.h b/include/haproxy/receiver-t.h index e4e9b2922..d1897de51 100644 --- a/include/haproxy/receiver-t.h +++ b/include/haproxy/receiver-t.h @@ -64,7 +64,6 @@ struct rx_settings { struct shard_info { uint nbgroups; /* number of groups in this shard (=#rx); Zero = unused. */ uint nbthreads; /* number of threads in this shard (>=nbgroups) */ - ulong tgroup_mask; /* bitmask of thread groups having a member here */ struct receiver *ref; /* first one, reference for FDs to duplicate */ struct receiver *members[MAX_TGROUPS]; /* all members of the shard (one per thread group) */ }; diff --git a/src/listener.c b/src/listener.c index 0ad6d7c84..69344d356 100644 --- a/src/listener.c +++ b/src/listener.c @@ -882,9 +882,7 @@ struct shard_info *shard_info_attach(struct receiver *rx, struct shard_info *si) } rx->shard_info = si; - BUG_ON (si->tgroup_mask & 1UL << (rx->bind_tgroup - 1)); - si->tgroup_mask |= 1UL << (rx->bind_tgroup - 1); - si->nbgroups = my_popcountl(si->tgroup_mask); + si->nbgroups++; si->nbthreads += my_popcountl(rx->bind_thread); si->members[si->nbgroups - 1] = rx; return si; @@ -913,8 +911,7 @@ void shard_info_detach(struct receiver *rx) BUG_ON(gr == MAX_TGROUPS); si->nbthreads -= my_popcountl(rx->bind_thread); - si->tgroup_mask &= ~(1UL << (rx->bind_tgroup - 1)); - si->nbgroups = my_popcountl(si->tgroup_mask); + si->nbgroups--; /* replace the member by the last one. If we removed the reference, we * have to switch to another one. It's always the first entry so we can