From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail-we0-f180.google.com ([74.125.82.180]:52209 "EHLO mail-we0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756411AbbBEIiZ convert rfc822-to-8bit (ORCPT ); Thu, 5 Feb 2015 03:38:25 -0500 Received: by mail-we0-f180.google.com with SMTP id m14so6250686wev.11 for ; Thu, 05 Feb 2015 00:38:24 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <1423084303.31870.15.camel@edumazet-glaptop2.roam.corp.google.com> References: <1422537297.21689.15.camel@edumazet-glaptop2.roam.corp.google.com> <1422628835.21689.95.camel@edumazet-glaptop2.roam.corp.google.com> <1422903136.21689.114.camel@edumazet-glaptop2.roam.corp.google.com> <1422926330.21689.138.camel@edumazet-glaptop2.roam.corp.google.com> <1422973660.907.10.camel@edumazet-glaptop2.roam.corp.google.com> <1423051045.907.108.camel@edumazet-glaptop2.roam.corp.google.com> <1423053531.907.115.camel@edumazet-glaptop2.roam.corp.google.com> <1423055810.907.125.camel@edumazet-glaptop2.roam.corp.google.com> <1423056591.907.130.camel@edumazet-glaptop2.roam.corp.google.com> <1423084303.31870.15.camel@edumazet-glaptop2.roam.corp.google.com> Date: Thu, 5 Feb 2015 09:38:23 +0100 Message-ID: (sfid-20150205_093835_119618_F6DFDFCC) Subject: Re: Throughput regression with `tcp: refine TSO autosizing` From: Michal Kazior To: Eric Dumazet Cc: Neal Cardwell , linux-wireless , Network Development , eyalpe@dev.mellanox.co.il Content-Type: text/plain; charset=UTF-8 Sender: linux-wireless-owner@vger.kernel.org List-ID: On 4 February 2015 at 22:11, Eric Dumazet wrote: > I do not see how a TSO patch could hurt a flow not using TSO/GSO. > > This makes no sense. Hmm.. @@ -2018,8 +2053,8 @@ static bool tcp_write_xmit(struct sock *sk, unsigned int mss_now, int nonagle, * of queued bytes to ensure line rate. * One example is wifi aggregation (802.11 AMPDU) */ - limit = max_t(unsigned int, sysctl_tcp_limit_output_bytes, - sk->sk_pacing_rate >> 10); + limit = max(2 * skb->truesize, sk->sk_pacing_rate >> 10); + limit = min_t(u32, limit, sysctl_tcp_limit_output_bytes); if (atomic_read(&sk->sk_wmem_alloc) > limit) { set_bit(TSQ_THROTTLED, &tp->tsq_flags); Doesn't this effectively invert how tcp_limit_output_bytes is used? This would explain why raising the limit wasn't changing anything anymore when you asked me do so. Only decreasing it yielded any change. I've added a printk to show up the new and old values. Excerpt from logs: [ 114.782740] (4608 39126 131072 = 39126) vs (131072 39126 = 131072) (2*truesize, pacing_rate, tcp_limit = limit) vs (tcp_limit, pacing_rate = limit) Reverting this patch hunk alone fixes my TCP problem. Not that I'm saying the old logic was correct (it seems it wasn't, a limit should be applied as min(value, max_value), right?). Anyway the change doesn't seem to be TSO-only oriented so it would explain the "makes no sense". MichaƂ