Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp836478pxu; Mon, 23 Nov 2020 05:32:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJwglx6+8qAoeXAsHCf6xgnKzx/6AKeYTZjl6QGzyKudxc6vgW3gm1M9+KcCb+RulcLVh1oH X-Received: by 2002:a17:906:f10e:: with SMTP id gv14mr43276863ejb.346.1606138329900; Mon, 23 Nov 2020 05:32:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606138329; cv=none; d=google.com; s=arc-20160816; b=Nwd84Wxl1tCiph6a7pIidmRuGt1JDO9eGGFiFTc+Y8G+HjwTW4DMyesgJqILFHNdT9 q+dYQru3RcIhMwdds3Ualbc6pJy1hUaEQYXMT0thFEyPYxG58Ewp7Jm+d7N4uZWZgAvM +vyqh4Fxk6YRfRnLuv2TEilerrATP7CRlTjTutXNwj9uzyHCIBULTTap4HJvp6rkLMhI 8IPMRHWs7SOW9MVjityqemqbX5uRHvY+Y+0B64MZwg6T8b2FpoJpdwdaqKPW9UR55nJ7 jGkUSejfvpSfi2hflc72aZCrG6cq9a6pSimmtbwmGwITGg7zUZ2WOqsP2il8XK3nv8hy NyIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Kdr1z6SFt0BuRj+3qASeLafQmvhjtgE0/g/iu+LDOZY=; b=Nu9YhG3RISiv9GAjh+lWmiIn1Qv9aVL6EDZ4EqcjGFLmGLWiwr5b+OM+bn6/BOX1w4 2ewAG8xf4wRNI9NUamZALuon4VD30nnmmEbNjiDy3bLKTXZ9A8XgF/pXMN3GcTJb3f8B qLSat3TUv3XdKxfNujCyouJkDynS844U2XDaL9sr5jAmPSkEryL1iPW+16le/sJRnm3Q g1+gN677mxU2/NIRJ/+qYjsK2WqPQq8L+AMHspr/+2ikg4OXidH234+HDc3Fq9StdROZ k+5svFJyLCYCZp3zKNRAlNHT1Cvo89tY/hrUek5z7PFnjfYCShmx7FjpdRHMOokp9asG L18w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=IIyzO2ix; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u11si6533892edt.221.2020.11.23.05.31.47; Mon, 23 Nov 2020 05:32:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=IIyzO2ix; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389229AbgKWN3E (ORCPT + 99 others); Mon, 23 Nov 2020 08:29:04 -0500 Received: from mail.kernel.org ([198.145.29.99]:41020 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730717AbgKWMaS (ORCPT ); Mon, 23 Nov 2020 07:30:18 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1714B20728; Mon, 23 Nov 2020 12:30:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1606134617; bh=0pojJR6AKeOEMOpmelMJr9Hcjb4UmeV4PG7iBTGkli4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IIyzO2ixIo8/xBn56QB+VWkLr4Ok+ZWkCxFdG36mF8SnrCsB9t8r4PkOiFjzoXE96 kM1sjhCZmJtiLWhH7nElYK+grP8WcHh/+jGpTiOj+Zi1T3nutx+JgtqBmDv68vmrXW FApLsOPyCZFuYJJ+8Ti9yc5V7A1gCIQ6ErylHRJE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ryan Sharpelletti , Neal Cardwell , Soheil Hassas Yeganeh , Yuchung Cheng , Jakub Kicinski Subject: [PATCH 4.19 22/91] tcp: only postpone PROBE_RTT if RTT is < current min_rtt estimate Date: Mon, 23 Nov 2020 13:21:42 +0100 Message-Id: <20201123121810.390774067@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201123121809.285416732@linuxfoundation.org> References: <20201123121809.285416732@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ryan Sharpelletti [ Upstream commit 1b9e2a8c99a5c021041bfb2d512dc3ed92a94ffd ] During loss recovery, retransmitted packets are forced to use TCP timestamps to calculate the RTT samples, which have a millisecond granularity. BBR is designed using a microsecond granularity. As a result, multiple RTT samples could be truncated to the same RTT value during loss recovery. This is problematic, as BBR will not enter PROBE_RTT if the RTT sample is <= the current min_rtt sample, meaning that if there are persistent losses, PROBE_RTT will constantly be pushed off and potentially never re-entered. This patch makes sure that BBR enters PROBE_RTT by checking if RTT sample is < the current min_rtt sample, rather than <=. The Netflix transport/TCP team discovered this bug in the Linux TCP BBR code during lab tests. Fixes: 0f8782ea1497 ("tcp_bbr: add BBR congestion control") Signed-off-by: Ryan Sharpelletti Signed-off-by: Neal Cardwell Signed-off-by: Soheil Hassas Yeganeh Signed-off-by: Yuchung Cheng Link: https://lore.kernel.org/r/20201116174412.1433277-1-sharpelletti.kdev@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- net/ipv4/tcp_bbr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/net/ipv4/tcp_bbr.c +++ b/net/ipv4/tcp_bbr.c @@ -917,7 +917,7 @@ static void bbr_update_min_rtt(struct so filter_expired = after(tcp_jiffies32, bbr->min_rtt_stamp + bbr_min_rtt_win_sec * HZ); if (rs->rtt_us >= 0 && - (rs->rtt_us <= bbr->min_rtt_us || + (rs->rtt_us < bbr->min_rtt_us || (filter_expired && !rs->is_ack_delayed))) { bbr->min_rtt_us = rs->rtt_us; bbr->min_rtt_stamp = tcp_jiffies32;