From patchwork Tue Mar 10 21:17:04 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neal Cardwell X-Patchwork-Id: 448719 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id E2846140146 for ; Wed, 11 Mar 2015 08:17:19 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="verification failed; unprotected key" header.d=google.com header.i=@google.com header.b=a+9IE6rr; dkim-adsp=none (unprotected policy); dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753265AbbCJVRP (ORCPT ); Tue, 10 Mar 2015 17:17:15 -0400 Received: from mail-yk0-f172.google.com ([209.85.160.172]:42679 "EHLO mail-yk0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752280AbbCJVRM (ORCPT ); Tue, 10 Mar 2015 17:17:12 -0400 Received: by ykbq9 with SMTP id q9so2036435ykb.9 for ; Tue, 10 Mar 2015 14:17:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=QaVngjj/GWJfCiyI7EE/bUpYMi7ZboHtEN3GY3WzZz0=; b=a+9IE6rrhTLz2EFhsDk3bSkfSAZuDTD//zN9pD7MoPdsaBDaoZiwWbCrFwR1GIPA+n lIXyoZMfbmq3PxhTJmXdsTcZQtQdgfTWIHhR92adGl0RGGV8wR+ZeiSYrmqjDU0Gbd+d 5SfAyIfFLmiSs2nImTedD3UuiQIN7FdLmfoKTnQEHbZfidYBnxiQzZ1+6DQTPpUefivL gH/APHTrsCDoNNKpVYrXTwiIcBnyo6CSfHnSFlshJM73QxNNmoq7Si+nuECvRmJ7HaE3 88wjUFX9BVwlfXiWDan51o27/bBpg7T0eVoHFystZIHowlE5EXfwa/7ThceMEV7KcrRU UhAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=QaVngjj/GWJfCiyI7EE/bUpYMi7ZboHtEN3GY3WzZz0=; b=kQM5+7LyeCoJf7zssrrqbYnbsK7m98NEDLRpjQy/8PbQ1XZQMvXpl35wFKtv+ny8x2 ZdgsSUXb8tdXaWocL26VUWBcM+cmIFKVrdv3sA8vZfQlrryxQxFDzeGLSAg1yDMm4xPW 8cV2gCISdKTfHkiYSlijAz9f5gA0dqSB+vWAhPj0nSrECEGt1QMCVXUEgC6RYka+ZPZy aHodoBjJazu1aiBST+HppxzkmHLh++wOAOaZ7oTGdg0sGUlJmBzySNM7xx8MTkJu5Z4j 4qdYVQwuKGP9mkpLCJ9mDHevU2Sq70i3k4ND9mHhLwr9x48fXjJO2KEYErRS0ZpAi9/A 7DkA== X-Gm-Message-State: ALoCoQnakmRY6YRfFA6L1c9j2iPaEqtGVc7Idu/DhuzDExTGDapWfCO1EIeTYwQrCl0wKetl62IY X-Received: by 10.236.62.136 with SMTP id y8mr33278574yhc.13.1426022231865; Tue, 10 Mar 2015 14:17:11 -0700 (PDT) Received: from coy.nyc.corp.google.com ([172.26.105.221]) by mx.google.com with ESMTPSA id c41sm1339154yhc.53.2015.03.10.14.17.11 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 10 Mar 2015 14:17:11 -0700 (PDT) From: Neal Cardwell To: David Miller Cc: netdev@vger.kernel.org, Neal Cardwell , Yuchung Cheng , Eric Dumazet Subject: [PATCH net 2/2] tcp: restore 1.5x per RTT limit to CUBIC cwnd growth in congestion avoidance Date: Tue, 10 Mar 2015 17:17:04 -0400 Message-Id: <1426022224-28793-2-git-send-email-ncardwell@google.com> X-Mailer: git-send-email 2.2.0.rc0.207.ga3a616c In-Reply-To: <1426022224-28793-1-git-send-email-ncardwell@google.com> References: <1426022224-28793-1-git-send-email-ncardwell@google.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Commit 814d488c6126 ("tcp: fix the timid additive increase on stretch ACKs") fixed a bug where tcp_cong_avoid_ai() would either credit a connection with an increase of snd_cwnd_cnt, or increase snd_cwnd, but not both, resulting in cwnd increasing by 1 packet on at most every alternate invocation of tcp_cong_avoid_ai(). Although the commit correctly implemented the CUBIC algorithm, which can increase cwnd by as much as 1 packet per 1 packet ACKed (2x per RTT), in practice that could be too aggressive: in tests on network paths with small buffers, YouTube server retransmission rates nearly doubled. This commit restores CUBIC to a maximum cwnd growth rate of 1 packet per 2 packets ACKed (1.5x per RTT). In YouTube tests this restored retransmit rates to low levels. Testing: This patch has been tested in datacenter netperf transfers and live youtube.com and google.com servers. Fixes: 9cd981dcf174 ("tcp: fix stretch ACK bugs in CUBIC") Signed-off-by: Neal Cardwell Signed-off-by: Yuchung Cheng Signed-off-by: Eric Dumazet --- net/ipv4/tcp_cubic.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/net/ipv4/tcp_cubic.c b/net/ipv4/tcp_cubic.c index 4b276d1..06d3d66 100644 --- a/net/ipv4/tcp_cubic.c +++ b/net/ipv4/tcp_cubic.c @@ -306,8 +306,10 @@ tcp_friendliness: } } - if (ca->cnt == 0) /* cannot be zero */ - ca->cnt = 1; + /* The maximum rate of cwnd increase CUBIC allows is 1 packet per + * 2 packets ACKed, meaning cwnd grows at 1.5x per RTT. + */ + ca->cnt = max(ca->cnt, 2U); } static void bictcp_cong_avoid(struct sock *sk, u32 ack, u32 acked)