From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf0-x232.google.com (mail-lf0-x232.google.com [IPv6:2a00:1450:4010:c07::232]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by huchra.bufferbloat.net (Postfix) with ESMTPS id 7FC9B21F627 for ; Sun, 20 Dec 2015 00:55:12 -0800 (PST) Received: by mail-lf0-x232.google.com with SMTP id y184so95291364lfc.1 for ; Sun, 20 Dec 2015 00:55:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; bh=yXaHwiDInePw9RDltmcnxPQ12QnbCQr8mbAcVPM3u88=; b=pp9cppTHJfGT7kR8NX72bHbJdGkjxt3Wc7C1zLgnQPJOLvEBz4PqbH+ELwc7LNe1Ah VPhhnLTCOzww3irrJgmU3GXQKzE/SI6B2/z7paC9/unDHZVGMlFmDu9kjf2tcbVhr4We mUx2IE8tWh9IEjeFZcjBKThL4zXUVpF/yLjNMy5t9/gqSAEDWs1tpUPj3Q6L3D3anxpc +DmtUQpc0rfVUy8KAQPBZlE7pXw/Pl5aGbcV/KI4t3C7Z3K0XD9SMBPsIGnx+aZN/9SZ Pzwj0ymo6m6bkZFkdlJ2AZWuAz+PlMmuB8nMsY1YpEsxA3HpyiBxvWWhxxI6IDQIfHED QZJA== X-Received: by 10.25.148.204 with SMTP id w195mr4311736lfd.108.1450601710068; Sun, 20 Dec 2015 00:55:10 -0800 (PST) Received: from datan.home.lan (c-479fe253.013-321-73746f13.cust.bredbandsbolaget.se. [83.226.159.71]) by smtp.gmail.com with ESMTPSA id o5sm3961150lbw.16.2015.12.20.00.55.08 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 20 Dec 2015 00:55:08 -0800 (PST) Content-Type: multipart/mixed; boundary="Apple-Mail=_D35A27C8-B4CE-45B7-8880-17C0E4D78EB3" Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) From: =?iso-8859-1?Q?Bj=F6rn_Gr=F6nvall?= In-Reply-To: Date: Sun, 20 Dec 2015 09:55:14 +0100 Message-Id: References: To: Dave Taht X-Mailer: Apple Mail (2.1878.6) Cc: cake@lists.bufferbloat.net Subject: Re: [Cake] and the bad cpu news on arm is X-BeenThere: cake@lists.bufferbloat.net X-Mailman-Version: 2.1.13 Precedence: list List-Id: Cake - FQ_codel the next generation List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Dec 2015 08:55:36 -0000 --Apple-Mail=_D35A27C8-B4CE-45B7-8880-17C0E4D78EB3 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 Hi Dave, The data cache on the wndr3800 and the archer is only 32k bytes. Some = arm models also have a small cache. Since the cake data structures are comparatively large it is important = to only bring data into the cache that will actually make a difference = when enqueueing. The attached patch avoids reading data that will not be used. It will = also save instructions when there are =93q->way_hits=94. N.B. If your arm has a large data cache this change may not make much of = a difference. Cheers, /b --Apple-Mail=_D35A27C8-B4CE-45B7-8880-17C0E4D78EB3 Content-Disposition: attachment; filename=sch_cake.c.diff Content-Type: application/octet-stream; name="sch_cake.c.diff" Content-Transfer-Encoding: 7bit diff --git a/sch_cake.c b/sch_cake.c index 2d03d5a..ac4cb83 100644 --- a/sch_cake.c +++ b/sch_cake.c @@ -329,42 +329,38 @@ cake_hash(struct cake_tin_data *q, const struct sk_buff *skb, int flow_mode) } else { u32 inner_hash = reduced_hash % CAKE_SET_WAYS; u32 outer_hash = reduced_hash - inner_hash; - u32 i, j, k; + u32 i, k; /* check if any active queue in the set is reserved for - * this flow. count the empty queues in the set, too + * this flow. */ - for (i = j = 0, k = inner_hash; i < CAKE_SET_WAYS; + for (i = 0, k = inner_hash; i < CAKE_SET_WAYS; i++, k = (k + 1) % CAKE_SET_WAYS) { if (q->tags[outer_hash + k] == flow_hash) { q->way_hits++; goto found; - } else if (list_empty(&q->flows[outer_hash + k]. - flowchain)) { - j++; } } - /* no queue is reserved for this flow */ - if (j) { - /* there's at least one empty queue, so find one - * to reserve. - */ - q->way_misses++; - - for (i = 0; i < CAKE_SET_WAYS; i++, k = (k + 1) - % CAKE_SET_WAYS) - if (list_empty(&q->flows[outer_hash + k]. - flowchain)) - goto found; - } else { - /* With no empty queues default to the original - * queue and accept the collision. - */ - q->way_collisions++; + /* no queue is reserved for this flow. find an empty + * queue to reserve. + */ + for (i = 0, k = inner_hash; i < CAKE_SET_WAYS; + i++, k = (k + 1) % CAKE_SET_WAYS) { + if (list_empty(&q->flows[outer_hash + k]. + flowchain)) { + q->way_misses++; + goto found; + } } + /* With no empty queues default to the original + * queue and accept the collision. + */ + k = inner_hash; /* evict this entry. */ + q->way_collisions++; + found: /* reserve queue for future packets in same flow */ reduced_hash = outer_hash + k; --Apple-Mail=_D35A27C8-B4CE-45B7-8880-17C0E4D78EB3 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 On 19 Dec 2015, at 21:03, Dave Taht wrote: > is that bcake configured via sqm to do 200mbit/20mbit, rings > in at 82% idle over a 2 minute period over a 1 minute rrul test. > cake, in all it's glory of statistics, extra features, bells, and = whistles... >=20 > is also 82% idle. >=20 > vs sqm's htb + fq_codel at 86% idle. >=20 > (in other words, this is not a direct measurement of the code under > 'load' but over a large sampling interval comparing idle with the > loaded state, AND (sigh) htb + fq_codel uses less cpu. am using the > mpstat 1 120 test for this from the openwrt sysstat package) >=20 > The good news from my perspective: >=20 > A) that it works at all with linux 4.4rc4 on the linksys 1200ac, which > was certainly not the case til last week > B) We CAN profile now > C) All systems for bandwidth (htb and cake) are accurate to 200mbit at > least, on this hardware >=20 > The bad news from my perspective: >=20 > A) I ran out of time for this back in august. Really have a ton of > wifi work stacked up. >=20 > B) I'd like to see someone show an instance where cake uses less cpu > or is better in any way than htb+ fq_codel. >=20 > There is a very small latency improvement (.8ms vs 1ms on this path). >=20 > I do not see any other appreciable difference in cpu usage or network > behavior... aside from negative ones. >=20 > Someone that's saying "ooh cake's better" *please* go measure rrul_be > while running "mpstat 1 120" for both sqm with fq_codel and sqm with > cake. >=20 > C) I will try to summon the energy to try it on mips myself, tomorrow. >=20 > -- > Dave T=C3=A4ht > Let's go make home routers and wifi faster! With better software! > https://www.gofundme.com/savewifi > _______________________________________________ > Cake mailing list > Cake@lists.bufferbloat.net > https://lists.bufferbloat.net/listinfo/cake -- Bj=C3=B6rn Gr=C3=B6nvall, bjorngx@gmail.com, Cell +46 70 768 06 35, = Jabber/XMPP: bg@kth.se =E2=80=9CThe ultimate tragedy is not the oppression and cruelty by the = bad people but the silence over that by the good people.=E2=80=9D =E2=80=95 Martin Luther King Jr. --Apple-Mail=_D35A27C8-B4CE-45B7-8880-17C0E4D78EB3--