Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp3058427rwe; Mon, 29 Aug 2022 05:16:28 -0700 (PDT) X-Google-Smtp-Source: AA6agR6kLubz1sCV8TAOTcDWTkbvCRgwFTTFXf6bUoTzddvPYd8lQvrffpIDSuBsHVRWYuQhOy50 X-Received: by 2002:a63:2cd0:0:b0:41c:5f9b:893c with SMTP id s199-20020a632cd0000000b0041c5f9b893cmr13708014pgs.173.1661775388722; Mon, 29 Aug 2022 05:16:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661775388; cv=none; d=google.com; s=arc-20160816; b=mqY+RnwYInvG+5AAYVmEN3ZWv4RBWw1l8X/szNBjxmVmKos6u3BYLCMOQgwut5j6US Dq9IodD7IfEBnew+EKNFxyI08eV/CvENrs7x7muA9st8IVOuHq9PF8W4KCPK6VZlQxNW ugEv1cW4CewlL2O4CYu1NAsF5adPiwPgbxPwiY991ETS2jfigMZNDnpv8T1O86S6JHNK 7H4js+/8+YPhUoD+Nw2dh2qycByarG67LZsG+dsnxkDIPzFD6AIm9nDQ0rBLYL2lzP1l U1vTfde1I4jOu5r/m79Bp8sROU3cDmn82t50rwT+zu0PF4qERui+YR3WCLj2K1gRpESS Z5yQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:content-disposition:mime-version :message-id:subject:to:from:date:dkim-signature; bh=/Di7lkoE4PMDXxx+KkgEBZLTyvjkUh6iLYQL6rsJ/+4=; b=bruQ3aZPJJqqoSQLUvi8pZr3Y7MdTcGBByKB0MRiNN5JmFEtiu3CA1GGrZdwYwCUKE ApqLVRHnZdR2xo6OMjDGI9MM+aqVHBWrDSCVB5FsWRvfgKDncltlMx/db4025m9cyGOW dqFiXPwjOaT0yfsaYNOH5qFOkYSNLyrfhqos/wPTPsV0Qs6czOijRBJFl9/ukbb9gBfI xxpkmuFRLW2fUEcVtV2u658yAtYBVeSpEKSRg3d1ZJoCmAXBQdgpD7x6ZCtMpiSJ9SZn SxLgNTkFIxMQgI7M2ytyXk6gYaQVWRLIZApmKmYsw1e/Sws9bATGVxZQof/KQ9MswINW 1Rrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=kaLiTO3u; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y4-20020a17090a644400b001fbbd1a3b6asi8747641pjm.84.2022.08.29.05.16.17; Mon, 29 Aug 2022 05:16:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=kaLiTO3u; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230107AbiH2MEP (ORCPT + 99 others); Mon, 29 Aug 2022 08:04:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33212 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229509AbiH2MDs (ORCPT ); Mon, 29 Aug 2022 08:03:48 -0400 Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com [209.85.221.49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C1ED89810; Mon, 29 Aug 2022 04:48:54 -0700 (PDT) Received: by mail-wr1-f49.google.com with SMTP id az27so9831033wrb.6; Mon, 29 Aug 2022 04:48:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=user-agent:content-disposition:mime-version:message-id:subject:to :from:date:from:to:cc; bh=/Di7lkoE4PMDXxx+KkgEBZLTyvjkUh6iLYQL6rsJ/+4=; b=kaLiTO3uz69oCN4+obPyA7IvFEwMUQt4ZXB/gpCbSytpTKaDsW0nIRGyUJlrfFsdvE mTMdi/Z4w215r5xJBREm+A9DCZWdKMDh9eP4c8/x3R5xGY1Hj6pf8n0K/p2+vM2pyS5q EH0TfHmeSyxe2CLjCBzM+P4TTrUSlSTU/5kLYioLrW6im0+coy5EfOhPV1wi9aFRYsKQ hdcV+CcTtuR2pH8q0XIYhRZxh8JLh0rNtGd2NdQ2X3bDN1rkv3ZahAOHeRI+AXcweHvy isZDOgf8r2OYCTu57efimyUr2retjmscs1Oo6dcHFsHyruJqIe81Jp4UvEJuyYovbuz2 4y9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=user-agent:content-disposition:mime-version:message-id:subject:to :from:date:x-gm-message-state:from:to:cc; bh=/Di7lkoE4PMDXxx+KkgEBZLTyvjkUh6iLYQL6rsJ/+4=; b=chtjH6W5gh6gGEp5VMHs68GGc3Nr+S0YFlEU2je8FdMhdQbHelfiKvHhH8GKOikjVf QU7XLyuDHXLZUzPfNrSvWqlA6Vl6IZelO2BkJdTn4DQYry147GqCAbAh67vV5fEPdRqN PJuaI/LH96yullbCgk6yYc2CY+cWL0IEMV658D6lia+VWJLuqLmIXC4Sx92UgXI86a0D XksO4wJotQ5LsO2e0hdE/w62dUOm4IpufRH/ktdfyz/jSl/mE/ju+WAMRB+PDYetTXn2 LqG3JLyDH9NXsIc+SHIYedpPGSaMucumE2FB4K+OJdvEquQMnLBtT3k6ZswgGiSNQRi3 W6nQ== X-Gm-Message-State: ACgBeo2dGpJAmrz/DzEbvpwZVbkqKsImg1/+K8tQS117HBZBW6F+e7TU Ooj9Jfufj9PjSWk5LeAOOEE= X-Received: by 2002:a5d:64e9:0:b0:220:7dd7:63eb with SMTP id g9-20020a5d64e9000000b002207dd763ebmr6085539wri.590.1661773583790; Mon, 29 Aug 2022 04:46:23 -0700 (PDT) Received: from debian ([89.238.191.199]) by smtp.gmail.com with ESMTPSA id i13-20020a05600c354d00b003a5f4fccd4asm8896858wmq.35.2022.08.29.04.46.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Aug 2022 04:46:23 -0700 (PDT) Date: Mon, 29 Aug 2022 13:44:35 +0200 From: Richard Gobert To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, corbet@lwn.net, yoshfuji@linux-ipv6.org, dsahern@kernel.org, alex.aring@gmail.com, stefan@datenfreihafen.org, pablo@netfilter.org, kadlec@netfilter.org, fw@strlen.de, kafai@fb.com, netdev@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-wpan@vger.kernel.org, netfilter-devel@vger.kernel.org, coreteam@netfilter.org Subject: [PATCH 0/4] net-next: frags: add adaptive per-peer timeout under load Message-ID: <20220829114427.GA2311@debian> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch series introduces an optimization of fragment queues under load. The goal is to improve upon the current approach of static timeouts (frag_timeout, 30 seconds by default) by implementing Eric's suggestion of reducing timeouts under load [1], with additional considerations for peer-specific load. The timeout reduction is done dynamically per peer, based on both global and peer-specific load. low_thresh is reintroduced and now acts as a knob for adjusting per-peer memory limits. A comparison of netperf results before and after applying the patch: Before: [vm1 ~]# ./super_netperf.sh 10 -H 172.16.43.3 -l 60 -t UDP_STREAM 103.23 After: [vm1 ~]# ./super_netperf.sh 10 -H 172.16.43.3 -l 60 -t UDP_STREAM 576.17 And another benchmark of a more specific use case. One high-bandwidth memory-hogging peer (vm1), and another "average" client (vm2), attempting to communicate with the same server: Before: [vm1 ~]# ./super_netperf.sh 10 -H 172.16.43.3 -l 60 -t UDP_STREAM 42.57 [vm2 ~]# ./super_netperf.sh 1 -H 172.16.43.3 -l 60 -t UDP_STREAM 50.93 After: [vm1 ~]# ./super_netperf.sh 10 -H 172.16.43.3 -l 60 -t UDP_STREAM 420.65 [vm2 ~]# ./super_netperf.sh 1 -H 172.16.43.3 -l 60 -t UDP_STREAM 624.79 These benchmarks were done using the following configuration: [vm3 ~]# grep . /proc/sys/net/ipv4/ipfrag_* /proc/sys/net/ipv4/ipfrag_high_thresh:104857600 /proc/sys/net/ipv4/ipfrag_low_thresh:78643200 /proc/sys/net/ipv4/ipfrag_max_dist:64 /proc/sys/net/ipv4/ipfrag_secret_interval:0 /proc/sys/net/ipv4/ipfrag_time:30 Regards, Richard [1] https://www.mail-archive.com/netdev@vger.kernel.org/msg242228.html Richard Gobert (4): net-next: frags: move inetpeer from ip4 to inet net-next: ip6: fetch inetpeer in ip6frag_init net-next: frags: add inetpeer frag_mem tracking net-next: frags: dynamic timeout under load Documentation/networking/ip-sysctl.rst | 3 + include/net/inet_frag.h | 13 ++--- include/net/inetpeer.h | 1 + include/net/ipv6_frag.h | 3 + net/ieee802154/6lowpan/reassembly.c | 2 +- net/ipv4/inet_fragment.c | 77 ++++++++++++++++++++++--- net/ipv4/inetpeer.c | 1 + net/ipv4/ip_fragment.c | 25 ++------ net/ipv6/netfilter/nf_conntrack_reasm.c | 2 +- net/ipv6/reassembly.c | 2 +- 10 files changed, 89 insertions(+), 40 deletions(-) -- 2.36.1