From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg0-x241.google.com (mail-pg0-x241.google.com [IPv6:2607:f8b0:400e:c05::241]) (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 DF27F3B2A3 for ; Fri, 27 Jan 2017 09:40:32 -0500 (EST) Received: by mail-pg0-x241.google.com with SMTP id 75so25172666pgf.3 for ; Fri, 27 Jan 2017 06:40:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:subject:from:to:cc:date:in-reply-to:references :mime-version:content-transfer-encoding; bh=FEcwP+shxRgpVw4hSPu0QyiEfiQq3M1T7sBkjTR5X0A=; b=eC30Lb+Mh01eLu15wGtinR4BfHz9ZOKvYPAi49bDz1g+w62eSG5mLjhmUhiz/18Ccg GVYR8yfvW1sjFOrtRMfklqoLxnz6g+jkkAYCBZ/dVmJaDsMLJeHl8S7+xHxHR+Ibyfnq JKYLWHRxUOR3IN5k7OkEaSHMrxjZJ3se3DdCfxrdRk7z1PJNbsSm90iadxiL8D4lgxd6 8urFN7L0P+PUW+oB/BgfiSUtTSVUdmho9spbUuhVJGnxD24xI3jIIAyMjv7p+ccOcHMK AtxBiLQf/JSWoUl3CspVkA8F/42wK20h7yOlQWv8T9AwT/0346CQCHLULYr2zNjZNDur X/tw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:mime-version:content-transfer-encoding; bh=FEcwP+shxRgpVw4hSPu0QyiEfiQq3M1T7sBkjTR5X0A=; b=gvic+w06sGmjgxBlF19H7SjW5g1vCotwe9GWUTiEVZvO8uYPXdVFWFsTsUyMM16AXV iAfVaIROz2sT0a7fDL7mFUY28Xb1T244FUUMF5eo4LTdJ72V99O9xdHTxLSRPyrtfctX MeNUEbv9ITyukbKsK5jMbsUHT8kIl5VNWKw7lniARchBG/IZi0PhJ+BQUZx9YKjmMJY4 TRCk4dfgRqhSgkE4d+jpl9bSJo8PNvjZ08ImlQfX1j+OqdDlj4AazxlqrJQk9ndzZXOM UAA6efQY67uYkAvUjml5Lz/bA7nLyBw6O+GPfvHbC9C0m+MLr1gk4EMM06xjLubjexi+ ZO8g== X-Gm-Message-State: AIkVDXJgMCrdyEZf+9v8oPwIDVnaZgFe8IW6PO5gMXn53+vpWEnDgyIFBFOWcM1R6K53RA== X-Received: by 10.84.247.2 with SMTP id n2mr12965341pll.39.1485528031916; Fri, 27 Jan 2017 06:40:31 -0800 (PST) Received: from [172.29.160.201] ([172.29.160.201]) by smtp.googlemail.com with ESMTPSA id 75sm11987559pfp.80.2017.01.27.06.40.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 Jan 2017 06:40:31 -0800 (PST) Message-ID: <1485528030.6360.35.camel@edumazet-glaptop3.roam.corp.google.com> From: Eric Dumazet To: Dave =?ISO-8859-1?Q?T=E4ht?= Cc: bloat@lists.bufferbloat.net Date: Fri, 27 Jan 2017 06:40:30 -0800 In-Reply-To: <0496946b-827a-8527-643d-0b186f52e192@taht.net> References: <0496946b-827a-8527-643d-0b186f52e192@taht.net> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.4-0ubuntu2 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: Re: [Bloat] Recommendations for fq_codel and tso/gso in 2017 X-BeenThere: bloat@lists.bufferbloat.net X-Mailman-Version: 2.1.20 Precedence: list List-Id: General list for discussing Bufferbloat List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jan 2017 14:40:33 -0000 On Thu, 2017-01-26 at 23:55 -0800, Dave Täht wrote: > > On 1/26/17 11:21 PM, Hans-Kristian Bakke wrote: > > Hi > > > > After having had some issues with inconcistent tso/gso configuration > > causing performance issues for sch_fq with pacing in one of my systems, > > I wonder if is it still recommended to disable gso/tso for interfaces > > used with fq_codel qdiscs and shaping using HTB etc. > > At lower bandwidths gro can do terrible things. Say you have a 1Mbit > uplink, and IW10. (At least one device (mvneta) will synthesise 64k of > gro packets) > > a single IW10 burst from one flow injects 130ms of latency. That is simply a sign of something bad happening from the source. The router will spend too much time trying to fix the TCP sender by smoothing things. Lets fix the root cause, instead of making everything slow or burn mega watts. GRO aggregates trains of packets for the same flow, in sub ms window. Why ? Because GRO can not predict the future : It can not know when next interrupt might come from the device telling : here is some additional packet(s). Maybe next packet is coming in 5 seconds. Take a look at napi_poll() 1) If device driver called napi_complete(), all packets are flushed (given) to upper stack. No packet will wait in GRO for additional segments. 2) Under flood (we exhausted the napi budget and did not call napi_complete()), we make sure no packet can sit in GRO for more than 1 ms. Only when the device is under flood and cpu can not drain fast enough RX queue, GRO can aggregate packets more aggressively, and the size of GRO packets exactly fits the CPU budget. In a nutshell, GRO is exactly the mechanism that adapts the packet sizes to available cpu power. If your cpu is really fast, then it will dequeue one packet at a time and GRO wont kick in. So the real problem here is that some device drivers implemented a poor interrupt mitigation logic, inherited from other OS that had not GRO and _had_ to implement their own crap, hurting latencies. Make sure you disable interrupt mitigation, and leave GRO enabled. e1000e is notoriously bad for interrupt mitigation. At Google, we let the NIC sends its RX interrupt ASAP. Every usec matters. So the model for us is very clear : Use GRO and TSO as much as we can, but make sure the producers (TCP senders) are smart and control their burst sizes. Think about 50Gbit and 100Gbit, and really the question of having or not TSO and GRO is simply moot. Even at 1Gbit, GRO is helping to reduce cpu cycles and thus reduce latencies. Adding a sysctl to limit GRO max size would be trivial, I already mentioned that, but nobody cared enough to send a patch. > > > > > If there is a trade off, at which bandwith does it generally make more > > sense to enable tso/gso than to have it disabled when doing HTB shaped > > fq_codel qdiscs? > > I stopped caring about tuning params at > 40Mbit. < 10 gbit, or rather, > trying get below 200usec of jitter|latency. (Others care) > > And: My expectation was generally that people would ignore our > recommendations on disabling offloads! > > Yes, we should revise the sample sqm code and recommendations for a post > gigabit era to not bother with changing network offloads. Were you > modifying the old debloat script? > > TBF & sch_Cake do peeling of gro/tso/gso back into packets, and then > interleave their scheduling, so GRO is both helpful (transiting the > stack faster) and harmless, at all bandwidths. > > HTB doesn't peel. We just ripped out hsfc for sqm-scripts (too buggy), > alsp. Leaving: tbf + fq_codel, htb+fq_codel, and cake models there. > > ... > > Cake is coming along nicely. I'd love a test in your 2Gbit bonding > scenario, particularly in a per host fairness test, at line or shaped > rates. We recently got cake working well with nat. > > http://blog.cerowrt.org/flent/steam/down_working.svg (ignore the latency > figure, the 6 flows were to spots all over the world) > > > Regards, > > Hans-Kristian > > > > > > _______________________________________________ > > Bloat mailing list > > Bloat@lists.bufferbloat.net > > https://lists.bufferbloat.net/listinfo/bloat > > > _______________________________________________ > Bloat mailing list > Bloat@lists.bufferbloat.net > https://lists.bufferbloat.net/listinfo/bloat