From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 06C47C43444 for ; Thu, 17 Jan 2019 08:18:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B4A7C20657 for ; Thu, 17 Jan 2019 08:18:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="nPpTBNvH" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730547AbfAQISw (ORCPT ); Thu, 17 Jan 2019 03:18:52 -0500 Received: from mail-pf1-f169.google.com ([209.85.210.169]:43644 "EHLO mail-pf1-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727343AbfAQISu (ORCPT ); Thu, 17 Jan 2019 03:18:50 -0500 Received: by mail-pf1-f169.google.com with SMTP id w73so4450679pfk.10 for ; Thu, 17 Jan 2019 00:18:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id; bh=9r9MSUaUZjjo62cauOlkQXLNsgqhwEuWyzliqBmyoDA=; b=nPpTBNvHmptoXdx/svT7AAugG4yruXkN/hYwUel3ZCpvLCTFjYDlmjKJWItz5aj+BK r/mCt/mZfweFAMRsQYGluO8x+s9SdmYcEwYpY1oWDdaerApekFZOiYr3cDqNFgc4V6ce ggEZLYjmzxVZ5plshk7Z8NOaRF/AWalzL385yyADHSYgzVM9xRf/wXjdtbvbyIni2xW9 sMK6X2vrviSA/N+9ycZLWnRjCzG7UszDCSR3R7wRSstM7d9nhnRksPExGkQl7BsNXBAc L822FewvRumjRV/fKuQk2ofpuWjXczRAUVu5RN6cwijtzpoFbAKbxGDsPhwI7ZVN5LII P1QA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=9r9MSUaUZjjo62cauOlkQXLNsgqhwEuWyzliqBmyoDA=; b=PbRUrFWO3/uVuBZ48cfr41pZLNrIggA+pjM9/xv7QJbtSwzyD6eM06mqMU3DTJGzJw mg6z7LAdilFV5tPju5dUwgEPtNWhVOAWMlffe31NGdAQBopk8snkT9/ptZV8GWcSRGb9 mEsLuxnTWy0bDQ5YCnIEIAhAVbRiGgf8XBlcl+EPa8vLG9o5A/MPJhsQaZjDvP9yT8Br zrJ6/Q1Kc2UoAifLqQNgq/7N3TzMGHohyEcmmL6n2m9KGPThKDYetsnJ8eCJ4Y4ILmxd +FfLtamE2eSOpAY2beNt2VZIxz/rLU450EtCUiLzh266rZxYGzNB13QM/lbO6Sp4WbeO nWAQ== X-Gm-Message-State: AJcUukfNeD96UU1nK3z+67On6YArTBLk7A3YswS6RhYimyzq7HkMj+aj anLaFEReJDSosDJN+QKiO3TX4TLzvPo= X-Google-Smtp-Source: ALg8bN5kuUT1QCExhIstewC1b/7V1bZ7FkH4gHiAw+ag2cW+NjjRFaEVaWmgfTefkuPY1vlKH/k8Kw== X-Received: by 2002:a63:ce08:: with SMTP id y8mr12474360pgf.388.1547713128797; Thu, 17 Jan 2019 00:18:48 -0800 (PST) Received: from localhost.localdomain ([2601:602:9602:6598:b47f:9ba1:630c:d2d]) by smtp.gmail.com with ESMTPSA id e24sm1309291pfi.153.2019.01.17.00.18.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 Jan 2019 00:18:48 -0800 (PST) From: yupeng To: netdev@vger.kernel.org, davem@davemloft.net, kuznet@ms2.inr.ac.ru, yoshfuji@linux-ipv6.org Subject: [PATCH net-next] remove TWKilled counter Date: Thu, 17 Jan 2019 00:18:47 -0800 Message-Id: <20190117081847.7791-1-yupeng0921@gmail.com> X-Mailer: git-send-email 2.17.1 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The most possible way to trigger TWKilled is using tcp_tw_recycle, but tcp_tw_recycle was removed. The TWKilled could still be triggered if below conditions are satisfied: 1 the tw_timer expires in fin_wait_2 status 2 the timeout value of tw_timer is changed to less than 4 seconds (via net.ipv4.tcp_fin_timeout or TCP_LINGER2 option) But the 4 seconds threshold makes no sense in this scenario. So remove this counter. Signed-off-by: yupeng --- include/net/inet_timewait_sock.h | 3 +-- include/uapi/linux/snmp.h | 1 - net/ipv4/inet_timewait_sock.c | 31 +------------------------------ net/ipv4/proc.c | 1 - 4 files changed, 2 insertions(+), 34 deletions(-) diff --git a/include/net/inet_timewait_sock.h b/include/net/inet_timewait_sock.h index 78775038f011..b042c0baa2ca 100644 --- a/include/net/inet_timewait_sock.h +++ b/include/net/inet_timewait_sock.h @@ -69,8 +69,7 @@ struct inet_timewait_sock { /* these three are in inet_sock */ __be16 tw_sport; /* And these are ours. */ - unsigned int tw_kill : 1, - tw_transparent : 1, + unsigned int tw_transparent : 1, tw_flowlabel : 20, tw_pad : 2, /* 2 bits hole */ tw_tos : 8; diff --git a/include/uapi/linux/snmp.h b/include/uapi/linux/snmp.h index 86dc24a96c90..fb0a17337bf2 100644 --- a/include/uapi/linux/snmp.h +++ b/include/uapi/linux/snmp.h @@ -178,7 +178,6 @@ enum LINUX_MIB_ARPFILTER, /* ArpFilter */ LINUX_MIB_TIMEWAITED, /* TimeWaited */ LINUX_MIB_TIMEWAITRECYCLED, /* TimeWaitRecycled */ - LINUX_MIB_TIMEWAITKILLED, /* TimeWaitKilled */ LINUX_MIB_PAWSACTIVEREJECTED, /* PAWSActiveRejected */ LINUX_MIB_PAWSESTABREJECTED, /* PAWSEstabRejected */ LINUX_MIB_DELAYEDACKS, /* DelayedACKs */ diff --git a/net/ipv4/inet_timewait_sock.c b/net/ipv4/inet_timewait_sock.c index 88c5069b5d20..f0c4fe21909d 100644 --- a/net/ipv4/inet_timewait_sock.c +++ b/net/ipv4/inet_timewait_sock.c @@ -144,10 +144,7 @@ static void tw_timer_handler(struct timer_list *t) { struct inet_timewait_sock *tw = from_timer(tw, t, tw_timer); - if (tw->tw_kill) - __NET_INC_STATS(twsk_net(tw), LINUX_MIB_TIMEWAITKILLED); - else - __NET_INC_STATS(twsk_net(tw), LINUX_MIB_TIMEWAITED); + __NET_INC_STATS(twsk_net(tw), LINUX_MIB_TIMEWAITED); inet_twsk_kill(tw); } @@ -218,32 +215,6 @@ EXPORT_SYMBOL(inet_twsk_deschedule_put); void __inet_twsk_schedule(struct inet_timewait_sock *tw, int timeo, bool rearm) { - /* timeout := RTO * 3.5 - * - * 3.5 = 1+2+0.5 to wait for two retransmits. - * - * RATIONALE: if FIN arrived and we entered TIME-WAIT state, - * our ACK acking that FIN can be lost. If N subsequent retransmitted - * FINs (or previous seqments) are lost (probability of such event - * is p^(N+1), where p is probability to lose single packet and - * time to detect the loss is about RTO*(2^N - 1) with exponential - * backoff). Normal timewait length is calculated so, that we - * waited at least for one retransmitted FIN (maximal RTO is 120sec). - * [ BTW Linux. following BSD, violates this requirement waiting - * only for 60sec, we should wait at least for 240 secs. - * Well, 240 consumes too much of resources 8) - * ] - * This interval is not reduced to catch old duplicate and - * responces to our wandering segments living for two MSLs. - * However, if we use PAWS to detect - * old duplicates, we can reduce the interval to bounds required - * by RTO, rather than MSL. So, if peer understands PAWS, we - * kill tw bucket after 3.5*RTO (it is important that this number - * is greater than TS tick!) and detect old duplicates with help - * of PAWS. - */ - - tw->tw_kill = timeo <= 4*HZ; if (!rearm) { BUG_ON(mod_timer(&tw->tw_timer, jiffies + timeo)); atomic_inc(&tw->tw_dr->tw_count); diff --git a/net/ipv4/proc.c b/net/ipv4/proc.c index c3610b37bb4c..20a29736d07e 100644 --- a/net/ipv4/proc.c +++ b/net/ipv4/proc.c @@ -186,7 +186,6 @@ static const struct snmp_mib snmp4_net_list[] = { SNMP_MIB_ITEM("ArpFilter", LINUX_MIB_ARPFILTER), SNMP_MIB_ITEM("TW", LINUX_MIB_TIMEWAITED), SNMP_MIB_ITEM("TWRecycled", LINUX_MIB_TIMEWAITRECYCLED), - SNMP_MIB_ITEM("TWKilled", LINUX_MIB_TIMEWAITKILLED), SNMP_MIB_ITEM("PAWSActive", LINUX_MIB_PAWSACTIVEREJECTED), SNMP_MIB_ITEM("PAWSEstab", LINUX_MIB_PAWSESTABREJECTED), SNMP_MIB_ITEM("DelayedACKs", LINUX_MIB_DELAYEDACKS), -- 2.17.1