The only purpose from tgroup_mask seems to be to calculate how many
tgroups share the same shard, but this is an information we can
calculate differently, we just have to increment the number when a new
receiver is added to the shard, and decrement it when one is detached
from the shard. Removing thread group masks will allow us to increase
the maximum number of thread groups past 64.
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) */
};
}
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;
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