Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp2419298rbb; Wed, 28 Feb 2024 00:48:35 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVqocsCLRO8l2POL038E8TA0LDF9/9OSZQyIgF1FcMCUX2qjEkArrMaUBqUAeV/UAbrVUGy237fHQTmiTBLf2NcFVreIgLuoP+H+zTN2Q== X-Google-Smtp-Source: AGHT+IFriusc4i2oBefwZ/Iipfab18XggN76BCeaCHNinfOyql33NetuzU0Q3fSG76sImhf6U0Br X-Received: by 2002:a05:620a:28d5:b0:787:e5bd:10f2 with SMTP id l21-20020a05620a28d500b00787e5bd10f2mr5094377qkp.25.1709110114763; Wed, 28 Feb 2024 00:48:34 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709110114; cv=pass; d=google.com; s=arc-20160816; b=seVdok9zvIh23pJSOWDgnlA5S87hqAktYiz5uI25JzER1XBqdPyJvlyUnAcVZFKMCx 3vQDpk6wXcy2dNC3NOrCMYDFfI0v3mzWuKOVLiapLHx4QTWi7UMD5atuqEmV3sBzUQv0 fGkAH2zXaF53XlVu6Lw+Q7YPppyg9DFWg5o8LxbQPQ26zzRy+S264RL374SgHupDCIqI DSVkvhQhAHwDTgfenbrI3TU3SGgu7w2VFOVu87MYAHz/YzUYJ2gEN2V1VA3VnGu3aXQL 4XDdcC2nPWN26VT3J0NjETuiIml2dS85A7BFmrcHdY05LM4oqa3gDdVN0iLe/uRB4SaM 8v6w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=LOHdb4gC52VDJXjDwJCJAgGjMtqm1gMwO+f40BDHTaw=; fh=+pZY+VPkHNGOEQ5L9D+iszs/F9znPPij0KTZA3LRU9U=; b=aV4MVvZyfaQDlVLByw/mCfYFRSU4SiLbj/ZTqUkODiMEbSbgpbZBDu6lZ+1JP+2cCe 9beQZNtOGTn8GgvwrzpIhEOpvYfhYy1WJmO97FqZp3BU/tMDc/f202rY3lyujx+xo9Xw feRzzRgKKQG/I58zwU6oCHuiwzi89DrlQB4bw2jcShKPP/vWanMboTdfIylZo8SCCB8F T9CeWSMJwEdSqX5RNaSPzi4aOKpm48BFBwgckyJmp20TrjrBXes50D/FPifTopxhm5Rz zPfFiYosnEJay6nlZpK1di+6osQhPKLiaOoC8BD+gut1qfYftAv6SwVBuILJq46nMZue r9GQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=dg0LetI4; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-84699-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-84699-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id c10-20020a37e10a000000b007873fe9f4d2si9051467qkm.259.2024.02.28.00.48.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 00:48:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-84699-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=dg0LetI4; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-84699-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-84699-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 569F01C2156B for ; Wed, 28 Feb 2024 08:48:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8281E2D622; Wed, 28 Feb 2024 08:48:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="dg0LetI4" Received: from mail-ed1-f41.google.com (mail-ed1-f41.google.com [209.85.208.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E09162D052 for ; Wed, 28 Feb 2024 08:48:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.41 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709110104; cv=none; b=FxNYAmOjzZX9QfNCswvz3/cinJQ+zrImVUzD9LJZYj5vYscvSaGCFm3s021Qu3P6k7bW+2uh9Xp0/H3nA6xquenLWQ1tye9N+G6mG5995Ev2tZQtoVU2nr5OrftiC/FVxMtlLhcxTj4neKQNQ5ij8o6dPH1YvOoNI+dIogfnKbw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709110104; c=relaxed/simple; bh=c/lbvKiivAPjD0Mp3kf9YnP5KkMypKY04lHuqLtbkUM=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=CMUlMlXlZTznzp7gQTCbhmf1AqxDzXMxbS1tSLeoOgSVE7wCVig8USK97iFmY1Kv08G7rrjuUglQHu045lYAEY3epesMByeNZBaJKErxU4hqnOHSHqudBoOQbMDqm7TTuF439YiOnpzS8rXSIIYif1lDgArH8QTvmefOVM5pUlE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=dg0LetI4; arc=none smtp.client-ip=209.85.208.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Received: by mail-ed1-f41.google.com with SMTP id 4fb4d7f45d1cf-565223fd7d9so7109a12.1 for ; Wed, 28 Feb 2024 00:48:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1709110101; x=1709714901; 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=LOHdb4gC52VDJXjDwJCJAgGjMtqm1gMwO+f40BDHTaw=; b=dg0LetI4GImURkBNInhf7UKI4sbJF0LZqyrf5Scl5y3B8dWIghsoBmvvh3QxR7Pvqc pRN3vJL2bLXT6bDKpN7s7j50rqnTMgo2J9DVOzwApVT2QYlR+Q7n7iG2kRpGC0zDP8fU jWKUZ87U4vjc2x87d46GbpTfeIc+navgVcc09LSsW900dhKnjENgeBo31An85tDx2s+Y qbRoy/JqLSPp6iDx9THFCqAkN8lcHydWZR3UXYbpxk5R8a+orbMPsmT7WX/CoxgU8Ley 3aEBheZA3s25BNHj9iqL18WFSIWd8qWKrpzrMXFJsESx14Wf08MBriCiFp7Ac5wTUwqf gbaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709110101; x=1709714901; 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=LOHdb4gC52VDJXjDwJCJAgGjMtqm1gMwO+f40BDHTaw=; b=p35ESCIHt8ploR0dUFajRSaQuDYbiPTVbUQNwxdrPZyEByx/eEcE1v3WtWy0t6Uucd AOVqeIntAysJy9AdV5YktcLBKPXlfgmTx/ZLpYKfo6U7s3N84ezr3nEWOk6f4PO5v6ds GM7nbKdWn4NoT4X9LxoDzW5B7veZ0rOFyKKibIcAyLnKlMolHvba+bHROGWQCc42j3Qt +Wl8DQFjgXo0/tLl2hHMWka0Q8odsdRnhWfsReVEFR9I8xxCJcC0yXxSgJUS5ZKh4TNF wXmNi+apBrPXdFIrdKpBa0RQw2gCCWJqw3CS0PM3PSeVF0QW2q+j8/+IzupOL9Plq70q ZPgA== X-Forwarded-Encrypted: i=1; AJvYcCU/AYFc7Q7QtxX3mcp64rCijt7hUESH/LorAzNL81SdeOu4RGITeZyhWjDwHmBtP/yoRSpBo66FGednOk4+CvUmSGSsjWlMcthocIz3 X-Gm-Message-State: AOJu0YwzaUwvpS7gorDG+1FWbU2c5TLaFPVRKZRqn4AGJVB4/FFbOSyR 9J3dGK1HCnMISM6tsGCraJc8KkW7Z5J6XZB8MAJAHT8ajZR9cx2xSZQFbBWPzcHB9nvxU7aShME dm3aH6+cyKCaERyQXeV0EKDilw2vKFEWw65h1 X-Received: by 2002:a50:9f89:0:b0:55f:8851:d03b with SMTP id c9-20020a509f89000000b0055f8851d03bmr35131edf.5.1709110101052; Wed, 28 Feb 2024 00:48:21 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: In-Reply-To: From: Eric Dumazet Date: Wed, 28 Feb 2024 09:48:09 +0100 Message-ID: Subject: Re: Network performance regression in Linux kernel 6.6 for small socket size test cases To: Abdul Anshad Azeez Cc: davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com, corbet@lwn.net, dsahern@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Boon Ang , John Savanyo , Peter Jonasson , Rajender M Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Feb 28, 2024 at 7:43=E2=80=AFAM Abdul Anshad Azeez wrote: > > During performance regression workload execution of the Linux > kernel we observed up to 30% performance decrease in a specific networkin= g > workload on the 6.6 kernel compared to 6.5 (details below). The regressio= n is > reproducible in both Linux VMs running on ESXi and bare metal Linux. > > Workload details: > > Benchmark - Netperf TCP_STREAM > Socket buffer size - 8K > Message size - 256B > MTU - 1500B > Socket option - TCP_NODELAY > # of STREAMs - 32 > Direction - Uni-Directional Receive > Duration - 60 Seconds > NIC - Mellanox Technologies ConnectX-6 Dx EN 100G > Server Config - Intel(R) Xeon(R) Gold 6348 CPU @ 2.60GHz & 512G Memory > > Bisect between 6.5 and 6.6 kernel concluded that this regression originat= ed > from the below commit: > > commit - dfa2f0483360d4d6f2324405464c9f281156bd87 (tcp: get rid of > sysctl_tcp_adv_win_scale) > Author - Eric Dumazet > Link - > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit= /?id=3D > dfa2f0483360d4d6f2324405464c9f281156bd87 > > Performance data for (Linux VM on ESXi): > Test case - TCP_STREAM_RECV Throughput in Gbps > (for different socket buffer sizes and with constant message size - 256B)= : > > Socket buffer size - [LK6.5 vs LK6.6] > 8K - [8.4 vs 5.9 Gbps] > 16K - [13.4 vs 10.6 Gbps] > 32K - [19.1 vs 16.3 Gbps] > 64K - [19.6 vs 19.7 Gbps] > Autotune - [19.7 vs 19.6 Gbps] > > From the above performance data, we can infer that: > * Regression is specific to lower fixed socket buffer sizes (8K, 16K & 32= K). > * Increasing the socket buffer size gradually decreases the throughput im= pact. > * Performance is equal for higher fixed socket size (64K) and Autotune so= cket > tests. > > We would like to know if there are any opportunities for optimization in > the test cases with small socket sizes. > Sure, I would suggest not setting small SO_RCVBUF values in 2024, or you get what you ask for (going back to old TCP performance of year 2010= ) Back in 2018, we set tcp_rmem[1] to 131072 for a good reason. commit a337531b942bd8a03e7052444d7e36972aac2d92 Author: Yuchung Cheng Date: Thu Sep 27 11:21:19 2018 -0700 tcp: up initial rmem to 128KB and SYN rwin to around 64KB I can not enforce a minimum in SO_RCVBUF (other than the small one added in commit eea86af6b1e18d6fa8dc959e3ddc0100f27aff9f ("net: sock: adapt SOCK_MIN_RCVBUF and SOCK_MIN_SNDBUF")) otherwise many test programs will break, expecting to set a low value.