Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp2434951rdg; Mon, 16 Oct 2023 04:41:29 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHU3YIBua/anrB2210B3Ex0MMIkOdS406FwvIbqvxltz+gBtdEFNvId2/Rn5XGjqo6Frk3T X-Received: by 2002:a05:6358:1ca:b0:143:e3a:de5f with SMTP id e10-20020a05635801ca00b001430e3ade5fmr22500559rwa.26.1697456488866; Mon, 16 Oct 2023 04:41:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697456488; cv=none; d=google.com; s=arc-20160816; b=VGCbYIHkP7uAitgKnmkn50dnMVaOZZEEKODRFuvIMekKHkiUVdiWoaeY8r5KE3CYJ+ oe+0fRCwkX+w5NERmRupkg3RofyDyy0Jjwg9gQ6SI9jJkAQ2RqrsOQF7jk93BzInucqF fggZ/c4EW5BxaJeY49soM0qYvnZNa1sFwAWwWchqrk4Tv9DSy5JUTmfA5wa521Pb1I/J H3Mmrj4WEqiVfWd72VQG1yEBj5w9vZ7/Q8H/J0qCc2xFwDsndCoNU5M5PH4m6mFP3mET SyS5OZwEjn4SiiT8DHq9n02738giWekz6ixuDWqVLx6SxWnqoB9ql30XmVK/6PPzidQJ WAdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=2I6xiVgm8CDmOxobNPXJ5HYpt0gEXNwuNgT27rQ1pK8=; fh=Q5+bpp0YFaPradTwrr9Fz+6lib4JEB9j48Enupstj4g=; b=M+fS34PA/DxvJXPV8k3T6bmQ5HEhx04qoOXhaGnuyk3+KGErNox/dJwvZJZC/u70IM 8qYYDnQpG0vuIsmsN1GLWrSyMgugbnUuLsvKK4BrJnzWsgpowrCeFWEuePaAhPqwQY3h uncQmIM+FC6i2VVJjzpVDqcUAeF/EZjeoGzXUyHMXs+4jE1cq1v8Xj3BPVphr/mpqiul uKA6G1tj7kMuXqPwa5JSa3i09Dz93lLG7ZRKJy50mg6EhajJZ47yxi5Bx6Qk5jjkzRIh qaPS2pTla5dlQ9jYjn94v6K9vWKA4oHUIxFSmONSt1r4UTmFroMY4H8Z+dctdWDrOk1+ 23SA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=2Q5uhr7K; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id c2-20020a056a00248200b006bd2084d6ddsi4167101pfv.100.2023.10.16.04.41.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 04:41:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=2Q5uhr7K; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id A6ED48051174; Mon, 16 Oct 2023 04:41:26 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232986AbjJPLlG (ORCPT + 99 others); Mon, 16 Oct 2023 07:41:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45886 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231819AbjJPLlD (ORCPT ); Mon, 16 Oct 2023 07:41:03 -0400 Received: from mail-ed1-x52e.google.com (mail-ed1-x52e.google.com [IPv6:2a00:1450:4864:20::52e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 14306E5 for ; Mon, 16 Oct 2023 04:41:00 -0700 (PDT) Received: by mail-ed1-x52e.google.com with SMTP id 4fb4d7f45d1cf-534694a9f26so11158a12.1 for ; Mon, 16 Oct 2023 04:41:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1697456458; x=1698061258; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=2I6xiVgm8CDmOxobNPXJ5HYpt0gEXNwuNgT27rQ1pK8=; b=2Q5uhr7KZnIOPozm+oy0vHWbp03Q1sFUZSwBPx0LsVQC/w/dnP/c3KuRsVKTGEu7kM AROIj0DxDxL1/YKoSGX7rM5Lq1lTKGlp1lkaJWGbrOjLbVJXxdpyCT1WYWzb3vbWOBgk anltbr9L+X2Hn1JBwCIzkQjRdEjjugweYDFB8mohX2nuHlw0wCfQMUy4FqZzgBkBaHdR 8SPVoFEJSGtEulLCD0j5oxaLuLvVE5dUJvuP0kmBS9RuKVQIuAeZGQ6X55Aqyj9Vn3md s2mtdAxgTRbWRYgZ+LzvH0GL2oEeUQ6/l+nyB3P1/YMPXJaPilTrFc8I/841CfVH1Yba CarQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697456458; x=1698061258; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2I6xiVgm8CDmOxobNPXJ5HYpt0gEXNwuNgT27rQ1pK8=; b=KjgN5EhL2mrtvr6J8e4FhshtvD7f7KGBLnW77sWcE1ddy3HmZpvtsIM6wqiSMWgo7m tnGG3uW6yf1KvnYp87WdsbQMY0zWcngxiMl1slmguoIGCQHUd1DVUmeW9aQsXIwlfLmN 4QEjb9+WgbO6YMtEh8QaaBHQ1USh4QXgqF7xlwhsFgSCmYjoQ1FLsEVEDZttlL3q/1h1 7hPZ1u5H4HHEfAJkIDFYHK7Ia7IEuUIpej0e+fDvNdJk1Ok93/GlfulckWVh3LuGK6OG ee7QmHLikuOLjIDQpJNYCLlq0IJbWEE5Rc6Z3VzCfXbRoLAb9uLY3H5gkzK31nJnd+kB ppsA== X-Gm-Message-State: AOJu0YwBw8BbBMz/0wRmyo6B40iuF5iJ4OTkKr9EqXUICWOth6KspD6S SEvZkftBgNUNCmSk762uLg/BUQpFWuUIaGViYh2PGA== X-Received: by 2002:a50:cd16:0:b0:538:1d3a:d704 with SMTP id z22-20020a50cd16000000b005381d3ad704mr155111edi.1.1697456458241; Mon, 16 Oct 2023 04:40:58 -0700 (PDT) MIME-Version: 1.0 References: <1697056244-21888-1-git-send-email-haiyangz@microsoft.com> In-Reply-To: <1697056244-21888-1-git-send-email-haiyangz@microsoft.com> From: Eric Dumazet Date: Mon, 16 Oct 2023 13:40:43 +0200 Message-ID: Subject: Re: [PATCH net-next,v3] tcp: Set pingpong threshold via sysctl To: Haiyang Zhang Cc: linux-hyperv@vger.kernel.org, netdev@vger.kernel.org, kys@microsoft.com, davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com, corbet@lwn.net, dsahern@kernel.org, ncardwell@google.com, ycheng@google.com, kuniyu@amazon.com, morleyd@google.com, mfreemon@cloudflare.com, mubashirq@google.com, linux-doc@vger.kernel.org, weiwan@google.com, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-8.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Mon, 16 Oct 2023 04:41:26 -0700 (PDT) On Wed, Oct 11, 2023 at 10:31=E2=80=AFPM Haiyang Zhang wrote: > > TCP pingpong threshold is 1 by default. But some applications, like SQL D= B > may prefer a higher pingpong threshold to activate delayed acks in quick > ack mode for better performance. > ... > > diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c > index f207712eece1..7d0fe76d56ef 100644 > --- a/net/ipv4/tcp_output.c > +++ b/net/ipv4/tcp_output.c > @@ -170,10 +170,10 @@ static void tcp_event_data_sent(struct tcp_sock *tp= , > tp->lsndtime =3D now; > > /* If it is a reply for ato after last received > - * packet, enter pingpong mode. > + * packet, increase pingpong count. > */ > if ((u32)(now - icsk->icsk_ack.lrcvtime) < icsk->icsk_ack.ato) > - inet_csk_enter_pingpong_mode(sk); > + inet_csk_inc_pingpong_cnt(sk); > } > > /* Account for an ACK we sent. */ OK, but I do not think we solved the fundamental problem of using jiffies for this heuristic, especially for HZ=3D100 or HZ=3D250 builds. Reviewed-by: Eric Dumazet