On Wed, 2020-12-16 at 21:43 +0100, Felix Fietkau wrote: > > + u32 *flows_bitmap; > + fq->flows_bitmap[idx / 32] &= ~BIT(idx % 32); > + for (base = 0; base < fq->flows_cnt; base += 32) { > + u32 mask = fq->flows_bitmap[base / 32]; This all seems a little awkward, why not use unsigned long * and <linux/bitops.h>? The &=~ BIT() thing above is basically __clear_bit() then, the loops later are basically for_each_set_bit() if I'm reading things right. > + if (!flow->backlog) { > + if (flow != &tin->default_flow) > + fq->flows_bitmap[idx / 32] |= BIT(idx % 32); That could be __set_bit() > + fq->flows_bitmap = kcalloc(DIV_ROUND_UP(fq->flows_cnt, 32), sizeof(u32), > + GFP_KERNEL); And that would just use BITS_TO_BYTES()? johannes