From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (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 E96E45B21A for ; Thu, 26 Feb 2026 01:10:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.49 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772068230; cv=none; b=h8s+BiJneoQZbKh1jpZ1nNk1TVMPNUv0dP1f5OdefZh/LUX9OToJF9Qei8yYYA3fzn9W9YvtzuuMwpgi1Xhn6BsCeuBQ7wzyHKA6iNF8KjBl26oValADcRWRqh/ulXemoC9+XDeFKq0CY9L9+HKh3rAMqVSSuEgAj0DC+pGp9W0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772068230; c=relaxed/simple; bh=bVKeetAWpDWtNFOjR1cupYE2E+MK02JGDxKWHamheRQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=cBbxwk69SK5KwT9Il5KIvIGSRmVYqb6E+c6eS7Lu3R9jVi6JOsz2PZRuQtSPaqeXUSIV332pi57WUZA48ztH+NivJuOwjmD7BTcU0LDJ4aW126MAJVcjgS7wDlNso4dKbwgqHj4CbLs143wrOHOb0eQ9z8Oj81sVkZHr+vyV5fg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=OoRU3j2j; arc=none smtp.client-ip=209.85.128.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="OoRU3j2j" Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-48372efa020so2586255e9.2 for ; Wed, 25 Feb 2026 17:10:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1772068227; x=1772673027; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=0mydpigOQEThp2HKi5IwwcPNGNIjpCFrRJAibYsBFDc=; b=OoRU3j2joHuRNxjXiBw9TlLN6FNUwyb4IsMIEixDj8kIjimU3r3Feisx3Kv2RTRK6q oxIy4H6cX6ke4fgxcTtUnhu52aDniXmMGPFobYfhoIhE55b1tSsCue/yNThCX7QP4lAH TI9ya+iSVvJydbYSFS+IDr3/wl7oHestaCKu9lfHQDyuHo9aAIzuLkf1G2DH7PwumvNm SvlFSCWQChDF3obDYf+DBbqyN/gkbCbrHsh1bZi4AJb9elMhnduqqs6h8aOzF9+QyB8K u2eJ+9igjwCSEFLQvyKCbbR1mojxJNUCMtpBGdzuK378TtxpLR7RyKBBFa2n+xqmQKFv 7DpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772068227; x=1772673027; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0mydpigOQEThp2HKi5IwwcPNGNIjpCFrRJAibYsBFDc=; b=SZHYSitUJdertSna5u5GukK/qFo87vONxUco3UvRBi2RT6HNQzcRtdU6bYBD/kaQRP Fj/If7YsBBuiKPf4+JW3rsBIMGf7WZSa22qlQNZuqsLw/Ww36PLY2mO0ReL3w18r/mlB Dbn8vkuGSP4njlEjugUmwtnMcVs2472nrZlG9bKH5Mr7zhLcMsPXBm9lywLMVwWAw94w 2jN3/0uYHoFXFY0M3QYayyKUoLN8Cr88TXKc1e5wiE9Y4zO6vEwmfYMqiZeroNdYeK7F CyysDSr5GPz91P3x8gR3glwvbkmUOUkvdQU6vwYaxNexo/YiIB+kAcIVJW3zigd7EOth wumQ== X-Forwarded-Encrypted: i=1; AJvYcCVee7PzLOcR/kfwd8xPTv9DAeM0AnFsp1o2NKR48mJKp09HnNoGdhw8Fo3P9Xh3pqMfPVAR1gFZd6n7VxA=@vger.kernel.org X-Gm-Message-State: AOJu0YyNPuacTFTCReML/NvwU+Funxg1uWFIsGkG8PsXJahHql4wBG8j aBBFDD1OAg1ZOyXUWrgD7MY3yxC9g/DFJbzhF1lf/H9fKGg1MfBPlZGb X-Gm-Gg: ATEYQzx9jK1z8woPFyCZgnsVaOj+2xulflQot6ZOZaYLaaHjCZJcvGRgMdH5eZoxG4E Hs/4QDpHttICTVxdtyWH8kwwD4Vu9116OZ8wUE8pX1tHJWyS+tEplU3YeivnjklmrQYsHsYm9CO CVCovlm8PDW6Cj7SofCoalS1WF+vAPp+LoRLzBrLYQs4UDZz/wqR1aWbHD93abNKg68VGb9gpb3 ODR+1ZdGCq7Fjr5etaz1u+Dok0Y/ihyRmZIavmkDQpxD8dE/4X1lN/TNPRwnjA170Xhxch9+nlY DQZQy1NIgRRfBaIK5Uhx2sQ2kEHidEfK2q+PMchXiiNj/Dge1pfUx07VvC+NJrtneJmMBXDazYV v6URpW2rTVT8yUrSV+Sv1xL1QnmjjsrSZGsH1weXjCv4fofpEV4dWbHX0OyfIi75RbDCYa6I3Bz bs3xY2NhPGDnkjHCEPrZK1+Z76G4FBbCJWFQ1t/C1LB1dfYquKU9Su/8Ml44VYwQ== X-Received: by 2002:a05:600c:621b:b0:477:63a4:88fe with SMTP id 5b1f17b1804b1-483c216bdbfmr40257915e9.2.1772068227170; Wed, 25 Feb 2026 17:10:27 -0800 (PST) Received: from gandalf.schnuecks.de (p5b2e2ef5.dip0.t-ipconnect.de. [91.46.46.245]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-483bfbb465bsm57533635e9.3.2026.02.25.17.10.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Feb 2026 17:10:26 -0800 (PST) Received: by gandalf.schnuecks.de (Postfix, from userid 500) id E52372FE1F55; Thu, 26 Feb 2026 02:10:25 +0100 (CET) Date: Thu, 26 Feb 2026 02:10:25 +0100 From: Simon Baatz To: Stefano Brivio Cc: Simon Baatz via B4 Relay , Eric Dumazet , Neal Cardwell , Kuniyuki Iwashima , "David S. Miller" , Jakub Kicinski , Paolo Abeni , Simon Horman , Jonathan Corbet , Shuah Khan , David Ahern , Jon Maloy , Jason Xing , mfreemon@cloudflare.com, Shuah Khan , Christian Ebner , netdev@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: Re: [PATCH RFC net-next 1/4] tcp: implement RFC 7323 window retraction receiver requirements Message-ID: References: <20260220-tcp_rfc7323_retract_wnd_rfc-v1-0-904942561479@gmail.com> <20260220-tcp_rfc7323_retract_wnd_rfc-v1-1-904942561479@gmail.com> <20260223232636.1ead2b3e@elisabeth> <20260225223325.34468327@elisabeth> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260225223325.34468327@elisabeth> On Wed, Feb 25, 2026 at 10:33:34PM +0100, Stefano Brivio wrote: > On Tue, 24 Feb 2026 19:07:45 +0100 > Simon Baatz wrote: > > > Hi Stefano, > > > > On Mon, Feb 23, 2026 at 11:26:40PM +0100, Stefano Brivio wrote: > > > Hi Simon, > > > > > > It all makes sense to me at a quick look, I have just some nits and one > > > more substantial worry, below: > > > > > > On Fri, 20 Feb 2026 00:55:14 +0100 > > > Simon Baatz via B4 Relay wrote: > > > > > > > From: Simon Baatz > > > > > > > > By default, the Linux TCP implementation does not shrink the > > > > advertised window (RFC 7323 calls this "window retraction") with the > > > > following exceptions: > > > > > > > > - When an incoming segment cannot be added due to the receive buffer > > > > running out of memory. Since commit 8c670bdfa58e ("tcp: correct > > > > handling of extreme memory squeeze") a zero window will be > > > > advertised in this case. It turns out that reaching the required > > > > "memory pressure" is very easy when window scaling is in use. In the > > > > simplest case, sending a sufficient number of segments smaller than > > > > the scale factor to a receiver that does not read data is enough. > > > > > > > > Since commit 1d2fbaad7cd8 ("tcp: stronger sk_rcvbuf checks") this > > > > happens much earlier than before, leading to regressions (the test > > > > suite of the Valkey project does not pass because of a TCP > > > > connection that is no longer bi-directional). > > > > > > Ouch. By the way, that same commit helped us unveil an issue (at least > > > in the sense of RFC 9293, 3.8.6) we fixed in passt: > > > > > > https://passt.top/passt/commit/?id=8d2f8c4d0fb58d6b2011e614bc7d7ff9dab406b3 > > > > This looks concerning: It seems as if just filling the advertised > > window triggered the out of memory condition(?). > > Right, even if it's not so much a general "out of memory" condition: > it's just that the socket might simply refuse to queue more data at > that point (we run out of window space, rather than memory). > > Together with commit e2142825c120 ("net: tcp: send zero-window ACK when > no memory"), we will even get zero-window updates in that case. Jon > raised the issue here: > > https://lore.kernel.org/r/20240406182107.261472-3-jmaloy@redhat.com/ > > but it was not really fixed. Anyway: Didn't that result in 8c670bdfa58e ("tcp: correct handling of extreme memory squeeze")? > [...] -- Simon Baatz