From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qk0-x234.google.com (mail-qk0-x234.google.com [IPv6:2607:f8b0:400d:c09::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.bufferbloat.net (Postfix) with ESMTPS id A98B83B29E for ; Mon, 30 Jul 2018 07:05:59 -0400 (EDT) Received: by mail-qk0-x234.google.com with SMTP id c126-v6so7446524qkd.7 for ; Mon, 30 Jul 2018 04:05:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=e0MlWQmKoCCcjY9xgzUqXDTuDwKiSjjkPdTL+piU1Ho=; b=D+hqCUbM4YO2YTWgY/DMI/rm/Aa2SBVK4fzMXzQWiEoUZd1JeH6Vxky1AMzYAXm7pU oxlE1eewr5oAHoT8HuCifAlYu5rFyRuoYg17e2ephDJ7pPDNWcujpIvADb2LI1NPoIor kQAGk0grqoSxFZ8pspG8sPo7Iun3hYiD0lSomYXbS8ryw/l13dM32i1nTLMVGQA1Z5hx FuIhJS6kSBYFCLMBbqFW4zgXGEisGeRKJXV1Zkwhl9FcZE1wcrpwv2T1fMUg78QFiMiu +6FYXCDMbrsvX74fNaAUDt32BE/jZvjLiX0iDMeRHe8q/kC6vFlRzDdp2fIOR2/Watyo WYKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=e0MlWQmKoCCcjY9xgzUqXDTuDwKiSjjkPdTL+piU1Ho=; b=R/n2SV7xzgvmw+TpBAX2PW3/TZwKO1b8Q3hUkyK7mjUDfHB8+UklgMZPf3nW2m/sB2 VhEgXDT1kNgb9N8tKcX4AI2z+uPd/yjgyWWNgUZ8GYlb43xja9QkApuKn2zIGFg49Nv1 JSaZyEZ+UROM/w0VyiH5+X7MFxFXm2fCqDHQde2PmkrYOB13UBmlAomLyJH21iPliQEv 4W0FpEbaeBi8LnZ7v5jUQlaDmKW9sdUCg+ZmA6JrP/vEOtgxcrwYlJq6+zFz9lWBEXJ2 MygMKiKJh+z8BrIgddGdxlxlP0yxLQsiDR1oa5MzqyRBOE2+HRKfiA1Ss9qz4Fh+DCFs t4LQ== X-Gm-Message-State: AOUpUlGkCgB8qWjkXM8n0gYY9j35umoRPGKDn2FZzCQG9SNxJ3JvHTbM gyoha4/EPeGUt70d1FZ2s84nyccMlNSWM7zjEcXNNg== X-Google-Smtp-Source: AAOMgpdYylAZ/sAp9F/6q0+OvxqZmFYyhYl43+r6GYDWNQb+02eXH184xfE7SarW2vL13qnWCCJtVFoAJJNL9i44IHQ= X-Received: by 2002:a37:ab14:: with SMTP id u20-v6mr14941676qke.120.1532948759344; Mon, 30 Jul 2018 04:05:59 -0700 (PDT) MIME-Version: 1.0 References: <1357421162.31089.1531812291583@webmail.strato.de> <1c323544b3076c0ab31b887d6113f25f572e41ae.camel@coverfire.com> <87woth28rw.fsf@toke.dk> <87tvol1z6h.fsf@toke.dk> <87wotfzql8.fsf@toke.dk> <87r2jlzwew.fsf@toke.dk> <305C8083-A170-42E8-BC96-120D3B0065EA@heistp.net> <8893BD36-72A4-4FC8-A013-BBB97F0E879B@gmx.de> In-Reply-To: From: Jonathan Morton Date: Mon, 30 Jul 2018 14:05:38 +0300 Message-ID: To: Pete Heist Cc: Sebastian Moeller , Cake List Content-Type: multipart/alternative; boundary="000000000000429b3705723572f6" Subject: Re: [Cake] =?utf-8?q?Using_cake_to_shape_1000=E2=80=99s_of_users=2E?= X-BeenThere: cake@lists.bufferbloat.net X-Mailman-Version: 2.1.20 Precedence: list List-Id: Cake - FQ_codel the next generation List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jul 2018 11:05:59 -0000 --000000000000429b3705723572f6 Content-Type: text/plain; charset="UTF-8" The big thing to note here is that it needs to be a power of two, so that the modulo operation on the hash table is really a mask operation, not a divide. It's easy to tell the compiler that if it's a compile time constant. Needs a lot more finesse if it's not. But it could reasonably be configurable at compile time. Just make sure to spit the dummy out if it's a weird size. - Jonathan Morton --000000000000429b3705723572f6 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

The big thing to note here is that it needs to be a power of= two, so that the modulo operation on the hash table is really a mask opera= tion, not a divide.=C2=A0 It's easy to tell the compiler that if it'= ;s a compile time constant.=C2=A0 Needs a lot more finesse if it's not.=

But it could reasonably be configurable at compile time.=C2= =A0 Just make sure to spit the dummy out if it's a weird size.

- Jonathan Morton

--000000000000429b3705723572f6--