Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp3969515ybl; Mon, 3 Feb 2020 09:59:34 -0800 (PST) X-Google-Smtp-Source: APXvYqz2zWiIBWVCF93+EdMnmC9T1wpNSsH3WilprKAmQxFFMAuwbXw4pnm09PfHUznQE38tSlzn X-Received: by 2002:a05:6830:2154:: with SMTP id r20mr19227562otd.131.1580752774572; Mon, 03 Feb 2020 09:59:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580752774; cv=none; d=google.com; s=arc-20160816; b=oFtZ0DbKjWrMHlZmngRazwvfDW5xz2SsS6sQ75dNvVVcOjQVu+82U/XUK0JBn2UB9K 78g3P6LkhNAx+viTkn9KOBemHBq4A4mkA9gVh6w6RFTSZcLGoi9RyVmkV1jy5REJCek1 li2Ab0D5yhkXxMmq8F57SuMrXUtSdJoYSthKa0cnjnr2QMM3LIaahC5goFPleGfPyjuP j386pjjdhO44RckSJX3iCdXHF/9ORLvMWNpuQ1g0reGCki1s/Q65d7eSoz1st1Ja8LeT 1N9fqhXp/wueGxEp28RdJ3d/PCdasW5ECk+6/hvIIDLj4yhNdkzXi8VQKYVEwYw8GVdB PZoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=mSZpSSrX1gkn4q4BYYE/uc6pa2MZhYOZnx1rar1JeDU=; b=sTw7L+Oa6fwqzifXrt9ZNdDYhAq6Bw8whZKTNw6FqAJyECwfb1u8cQzH3oVsEQpvAx aHHFECw4rWV5V7F9uY/cJVzDtDN5AT4CJ2VYTIsDZ3sS7bbsbkhYQgiEiT2xNTbMJ4T7 0JtGjBBkzRz+lV+VzAj9AJNsW/U49tgTgFLcdIY1qlwfTZYcT0zvJLyjiQg3TQMdjQfr TIwW+s/4RgbgnoNDHAciMMwSv7acCtD+o7M105z2KwsClpyiWi8gHSFZGdwabX6nwf7m hxpds2etPbyfgHAia+F19M4bblLI1aj8vmPR/bfxGA+gKc7HUcVQMevdosn9g+mj4IGT 0hnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=cNVYE3f5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id 4si4655122oip.107.2020.02.03.09.59.22; Mon, 03 Feb 2020 09:59:34 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=cNVYE3f5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1728353AbgBCPy4 (ORCPT + 99 others); Mon, 3 Feb 2020 10:54:56 -0500 Received: from mail-yw1-f67.google.com ([209.85.161.67]:39284 "EHLO mail-yw1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728193AbgBCPy4 (ORCPT ); Mon, 3 Feb 2020 10:54:56 -0500 Received: by mail-yw1-f67.google.com with SMTP id h126so14088099ywc.6 for ; Mon, 03 Feb 2020 07:54:55 -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=mSZpSSrX1gkn4q4BYYE/uc6pa2MZhYOZnx1rar1JeDU=; b=cNVYE3f5rZHULQiCtnVROGU8SPrQJtN5P3gwxhWiT06FesW8t8EPhhvoRdCdyRSWGD Pdm5AqvZeunWdsHx3WkHzH/yGWMo3CaukRjBhNGvY0s4oYi7yQXO9/jKDr/ejy+feAZj Q18KO8xrDCFpIWVDH0NWdFT0VisoIEKDtEIa62V2Z/6PAIssAAuLx9fG84Qcht4+FMaW sQ+3QJdZ38zsdrj3Y9kSNmHfdQpkDUXUDpDgTTRB7EyyPip6aAlC8VvFqbVOBoHIrneI 4T+9ya619FEA7beV6a+gPVNNdnlitPAzMqSABGEsAvG7f6BxBosnSxi8oZbGlMWmlS50 n6Fg== 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=mSZpSSrX1gkn4q4BYYE/uc6pa2MZhYOZnx1rar1JeDU=; b=gKAny6DMBIjP8eHEg3pMLPouPo1bPoOtDNDpoakJ1QbFfBq0HmMzUynpw/srxE+VU/ UeitBaMC0fANTeO6inMTpe2Ztk3vB9qZ5Urm7kZihMfX1ysR3ykcWX4DoAh/GaKPd+jJ hJe2B82wQx1nhfyZaqo0cqMHMgWDbUP4UE7S9TIgybrf41Jk3Xqc/Fli5r8PdxC6hDvj LeyOjucSdctNNVyhf/exlesNJJqJBSV+b/REZjDfUhASnz3Qu9UMg+U1tqAlfsToPHqM CVHlqPtzQncrvAXPrMBe3WIzi5qcSsyk7lcM3VbM4eGGuJgRWv+hd43DbfLP/KBQqAVV lYYA== X-Gm-Message-State: APjAAAXRwTTgHvZSni8tEhj337tV8whSWtb10RlBdW8QQG7VHX7rhAUO jZZNwsnypxF6Frd9HFyeDGGj2lXUDqpOJwhWZp67BA== X-Received: by 2002:a25:d112:: with SMTP id i18mr18684063ybg.364.1580745294734; Mon, 03 Feb 2020 07:54:54 -0800 (PST) MIME-Version: 1.0 References: <20200131122421.23286-1-sjpark@amazon.com> <20200131122421.23286-3-sjpark@amazon.com> <7d36a817-5519-8496-17cf-00eda5ed4ec7@gmail.com> <5a8c1658de8f49b2994d19d371c13c79@AcuMS.aculab.com> In-Reply-To: <5a8c1658de8f49b2994d19d371c13c79@AcuMS.aculab.com> From: Eric Dumazet Date: Mon, 3 Feb 2020 07:54:42 -0800 Message-ID: Subject: Re: [PATCH 2/3] tcp: Reduce SYN resend delay if a suspicous ACK is received To: David Laight Cc: Eric Dumazet , Neal Cardwell , "sjpark@amazon.com" , David Miller , "shuah@kernel.org" , Netdev , "linux-kselftest@vger.kernel.org" , LKML , "sj38.park@gmail.com" , "aams@amazon.com" , SeongJae Park , Yuchung Cheng Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 3, 2020 at 7:40 AM David Laight wrote: > > From: Eric Dumazet > > Sent: 31 January 2020 22:54 > > On 1/31/20 2:11 PM, Neal Cardwell wrote: > > > > > I looked into fixing this, but my quick reading of the Linux > > > tcp_rcv_state_process() code is that it should behave correctly and > > > that a connection in FIN_WAIT_1 that receives a FIN/ACK should move to > > > TIME_WAIT. > > > > > > SeongJae, do you happen to have a tcpdump trace of the problematic > > > sequence where the "process A" ends up in FIN_WAIT_2 when it should be > > > in TIME_WAIT? > > > > > > If I have time I will try to construct a packetdrill case to verify > > > the behavior in this case. > > > > Unfortunately you wont be able to reproduce the issue with packetdrill, > > since it involved packets being processed at the same time (race window) > > You might be able to force the timing race by adding a sleep > in one of the code paths. > > No good for a regression test, but ok for code testing. Please take a look at packetdrill, there is no possibility for it to send more than one packet at a time. Even if we modify packetdrill adding the possibility of feeding packets to its tun device from multiple threads, the race is tiny and you would have to run the packetdrill thousands of times to eventually trigger the race once. While the test SeongJae provided is using two threads and regular TCP stack over loopback interface, it triggers the race more reliably.