Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp2327061pxb; Mon, 11 Jan 2021 07:01:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJz3Pj25iuLlRSxzFlhMgiolaZTwH732PpUNU5LjW8TETPlWIdgoWgRDVOYsVzXZCo8syOzG X-Received: by 2002:a17:906:b793:: with SMTP id dt19mr10993146ejb.120.1610377264440; Mon, 11 Jan 2021 07:01:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610377264; cv=none; d=google.com; s=arc-20160816; b=vVPUgHLwLnVg/kxiWVho4VpGEYQtpgvezNX5085/DW2bWgh1ds0r1vvOU53mLs0deh gi7qzeUdahChjz+2ReUOECWQMoTH7dF6E4MOaK/dMA5ELAjaI73o2trZYghDwp7bIZya /UIq6P66HLzndgcO/N1sf5GRH7xN3M/Aj4Oz93cVtQDQ+sw0zKaa61dzLM6YMsbC/OmG 6iFshKXz4UsAe/FTDg8usOlWI3qg4i0sYUI5lpkGxpmOqVc/qQ4P4Scxt4Mx5IAtYwqG pAygO2iFdGRBNABPwL1UncDgvRjS1sQpiH1Y71QwexdgZAGu4VgXsmNlhcdMRuCQiRUl uHYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=HCNTiunazZYLzBElVvBsIq1txvjnJLCjiClRs9NWjxM=; b=YhB8mcsUrplTaIENkL6XMg7VIPi9Ajz3o+xE+MU7IUPhcgbgRy7AJWxGyRyWAhmGHI qGjFyP6lbWLuqgevVzKDoMA9651a3g5XGA8My3QZJmc/u4/FprTvq4QV40HhhNT31JFH 3MbhRpe1gmoXUu81rLsnJgPjigcuVyOoF+eu/tyX8QM2eNxhUjL5kRkXJ7oidmocPkyK EF8GSEmUTMEvhXLw8xMV7UmFHXb8/muM3iLMgHG/5L3+MrjJyEQFpFbJ8CMDoQJu12xy mYKLt8dfvrhinc+CfUjr0y9RWVJON31hKCl0MxMNrGCApM2hhEOK5sCsc/AfcwvehGmZ +62g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=YTVMNzf3; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z17si6429928eja.534.2021.01.11.07.00.39; Mon, 11 Jan 2021 07:01:04 -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=@google.com header.s=20161025 header.b=YTVMNzf3; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732276AbhAKO7c (ORCPT + 99 others); Mon, 11 Jan 2021 09:59:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44004 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729285AbhAKO7b (ORCPT ); Mon, 11 Jan 2021 09:59:31 -0500 Received: from mail-ua1-x933.google.com (mail-ua1-x933.google.com [IPv6:2607:f8b0:4864:20::933]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4F07DC061786 for ; Mon, 11 Jan 2021 06:58:51 -0800 (PST) Received: by mail-ua1-x933.google.com with SMTP id k47so6035346uad.1 for ; Mon, 11 Jan 2021 06:58:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=HCNTiunazZYLzBElVvBsIq1txvjnJLCjiClRs9NWjxM=; b=YTVMNzf3e2QLEPvy1z+h+zOAWVuLqvcH9ukx2eVAT0DG39fwZQckZcdCQ6osLjvyqB W1Eok+rzydNg3x/ySgAS9J8GmnZj3T5ZFiXIpjlMQkfJ4QxtakPIIHeDDo5RhL3X4hYD BuruiWbOHSMJR1i99IwafVXZr28lq7wJOBDqF0LVqYIdF6HJKbk4UZYHshu1RYbpqUdN vx2u01UDuDZ0d7MOzQ8H+s+j9ooK/Xs8HQthOVRyvVWDnf61LUyOUaOuvI4JQhGHdqUj CFVWKljg59zWuINxFaakP2l3XJSxanVnzr1WyM4xwPQBd4gBJ2IcYI8uDYIDCGbIVI6j 0q6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=HCNTiunazZYLzBElVvBsIq1txvjnJLCjiClRs9NWjxM=; b=fEzNMX2m0ylOx/l6Q31w5g0u3rxDb6nVr9ZYdkjtn7fA6CkcJvmqH1gh3lKrHk6QZL 8Mydk27MAj+MO8o6yJBWfvXKpViesuPrq6SWpizNa1DrjqbDW0pm3Ygdw/zzcGrI6pxC GMEPpNqNU0Uf546UlzbOQm2AbYfphp/BrOe6VmcsoO51xTM5gdUZD7yLp6hczsh6KdK9 VuSXEdwBbfJ0J+sVW9KFW1B1bem1Y97EwZmtBmVjSCPqWKwu0LtSMIV95zXT7lsFDQQS as0ehOBYxEmVprK1Z+2ro5RNoK51848lbT/rDYI4ZotOsk3mOEyzOnnarY86y80Qk05+ aLTg== X-Gm-Message-State: AOAM5326Z9ZGuCb7bRw5DIyd1U8chShUVBJh5ywf+RgGd2fkF9mZdwIu +1SNTvco2SDQqYa9y+fUPM3J0s5DWkC8mmC6G7pL4A== X-Received: by 2002:ab0:634c:: with SMTP id f12mr13032319uap.63.1610377130152; Mon, 11 Jan 2021 06:58:50 -0800 (PST) MIME-Version: 1.0 References: <20210109043808.GA3694@localhost.localdomain> In-Reply-To: <20210109043808.GA3694@localhost.localdomain> From: Neal Cardwell Date: Mon, 11 Jan 2021 09:58:33 -0500 Message-ID: Subject: Re: [PATCH] Revert "tcp: simplify window probe aborting on USER_TIMEOUT" To: Enke Chen Cc: Eric Dumazet , "David S. Miller" , Alexey Kuznetsov , Hideaki YOSHIFUJI , Jakub Kicinski , Soheil Hassas Yeganeh , Yuchung Cheng , Netdev , LKML , Jonathan Maxwell , William McCall , enchen2020@gmail.com Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 8, 2021 at 11:38 PM Enke Chen wrote: > > From: Enke Chen > > This reverts commit 9721e709fa68ef9b860c322b474cfbd1f8285b0f. > > With the commit 9721e709fa68 ("tcp: simplify window probe aborting > on USER_TIMEOUT"), the TCP session does not terminate with > TCP_USER_TIMEOUT when data remain untransmitted due to zero window. > > The number of unanswered zero-window probes (tcp_probes_out) is > reset to zero with incoming acks irrespective of the window size, > as described in tcp_probe_timer(): > > RFC 1122 4.2.2.17 requires the sender to stay open indefinitely > as long as the receiver continues to respond probes. We support > this by default and reset icsk_probes_out with incoming ACKs. > > This counter, however, is the wrong one to be used in calculating the > duration that the window remains closed and data remain untransmitted. > Thanks to Jonathan Maxwell for diagnosing the > actual issue. > > Cc: stable@vger.kernel.org > Fixes: 9721e709fa68 ("tcp: simplify window probe aborting on USER_TIMEOUT") > Reported-by: William McCall > Signed-off-by: Enke Chen > --- I ran this revert commit through our packetdrill TCP tests, and it's causing failures in a ZWP/USER_TIMEOUT test due to interactions with this Jan 2019 patch: 7f12422c4873e9b274bc151ea59cb0cdf9415cf1 tcp: always timestamp on every skb transmission The issue seems to be that after 7f12422c4873 the skb->skb_mstamp_ns is set on every transmit attempt. That means that even skbs that are not successfully transmitted have a non-zero skb_mstamp_ns. That means that if ZWPs are repeatedly failing to be sent due to severe local qdisc congestion, then at this point in the code the start_ts is always only 500ms in the past (from TCP_RESOURCE_PROBE_INTERVAL = 500ms). That means that if there is severe local qdisc congestion a USER_TIMEOUT above 500ms is a NOP, and the socket can live far past the USER_TIMEOUT. It seems we need a slightly different approach than the revert in this commit. neal