Article View: linux.kernel.netdev
Article #19694Re: [PATCH net 1/3] tcp: saturate window-to-memory conversions at INT_MAX
From: netdev-bot+sashiko
Date: Fri, 20 Nov 2026 08:22
Date: Fri, 20 Nov 2026 08:22
94 lines
11260 bytes
11260 bytes
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.
Low priority / nit picks for your consideration:
- [Low] The author and DCO sign-off names do not match.
- [Low] (Baseline decision: not a valid regression; kept only because
requires_validation=true.) The concern: when scaling_ratio < 128 andβ¦
--
tcp: saturate window-to-memory conversions at INT_MAX
This commit caps the u64 result of __tcp_space_from_win() at INT_MAX
before it is returned as an int. Without the cap, large results can wrap
when narrowed. That lets the TCP and MPTCP SO_RCVLOWAT handlers accept a
large low watermark without raising sk_rcvbuf.
> Fixes: dfa2f0483360 ("tcp: get rid of sysctl_tcp_adv_win_scale")
> Signed-off-by: lllei <llleigoing@outlook.com>
[Severity: Low]
This isn't a bug, but the Signed-off-by name does not match the From
name. The author is "lei lei <llleigoing@outlook.com>" and the sign-off
is "lllei <llleigoing@outlook.com>". The email is the same but the names
differ, and checkpatch.pl reports this as FROM_SIGN_OFF_MISMATCH.
The other two patches in the series have the same mismatch:
net: bound receive window predictions before narrowing
mptcp: exclude MSG_PEEK from receive buffer autotuning
Could the series be resent with one consistent identity?
> diff --git a/include/net/tcp.h b/include/net/tcp.h
> index 5c9203aae8341..09827f1ae0a72 100644
> --- a/include/net/tcp.h
> +++ b/include/net/tcp.h
> @@ -1799,7 +1799,7 @@ static inline int __tcp_space_from_win(u8 scaling_ratio, int win)
> u64 val = (u64)win << TCP_RMEM_TO_WIN_SCALE;
>
> do_div(val, scaling_ratio);
> - return val;
> + return min_t(u64, val, INT_MAX);
> }
[Severity: Low]
This probably isn't a regression, but one side effect of the saturation
is worth checking.
When scaling_ratio is below 128 and val is around tcp_rmem[2] >> 1, the
result saturates to INT_MAX. Then __tcp_win_from_space(ratio, INT_MAX)
is smaller than val, so sk_rcvbuf no longer covers sk_rcvlowat.
__tcp_set_rcvlowat() in net/ipv4/tcp.c still stores the full watermark
and raises window_clamp to val:
WRITE_ONCE(sk->sk_rcvlowat, val ? : 1);
...
space = tcp_space_from_win(sk, val);
if (space > sk->sk_rcvbuf) {
WRITE_ONCE(sk->sk_rcvbuf, space);
if (tp->window_clamp && tp->window_clamp < val)
WRITE_ONCE(tp->window_clamp, val);
}
mptcp_set_rcvlowat() in net/mptcp/sockopt.c does the same for the msk
and each subflow.
This seems harmless:
- __tcp_select_window() takes min_t(int, tp->window_clamp,
allowed_space), so the larger clamp is never advertised.
- For TCP, tcp_epollin_ready() falls back to tcp_rmem_pressure(), so a
watermark the buffer cannot reach does not stall the reader.
- The SOCK_RCVBUF_LOCK branch already accepts a watermark that the
buffer cannot back.
- Before this patch the budget was not raised at all.
mptcp_epollin_ready() has no rmem-pressure fallback. That limitation
predates this patch and can also be reached through the SOCK_RCVBUF_LOCK
path.
Should the commit message say that sk_rcvbuf can still be too small for
the requested SO_RCVLOWAT once it saturates?
--
Sashiko AI review Β· https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261117052200.1507847-1-llleigoing%40outlook.com
Technical Details
Message-ID:
<179516297210.3136.8495911905614638988@kernel.org>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-367777-linux-kernel-netdev=dewy.ruReferences:
<20261117052200.1507847-2-llleigoing@outlook.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-367777-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net 1/3] tcp: saturate window-to-memory conversions at INT_MAX Date: Fri, 20 Nov 2026 08:22:52 +0000 Organization: Usenet Network Message-ID: <179516297210.3136.8495911905614638988@kernel.org> References: <20261117052200.1507847-2-llleigoing@outlook.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="3105848"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:yAnU66Sa9j8CmgjHxkYf65y2L/s= sha256:QkkxBLDqWawGHV2u1dHgjw0jE2ivXYmwxAfzQvcTVcg= sha1:YW8JNYEsLkqxyaLHDO5wgujeJFg= sha256:c8c3BEsaXTIPOxmJfkHou7+SRMYfOFmtN8lrJYudG9s= List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id 376B4115908; Fri, 20 Nov 2026 11:23:09 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.4 X-Spam-Status: No, score=-3.4 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=kernel.org X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 72Wx5zTk28ze; Fri, 20 Nov 2026 11:23:05 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-367777-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id 9FC57115902; Fri, 20 Nov 2026 11:22:56 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id 7787922206C; Fri, 20 Nov 2026 08:22:54 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1795162974; b=Kf7XlE0BXFxwA5l2jm/YXYc1UXlIzW25N5RPR0MiIGtsaK6ca1+gxhYQbTMW50Tl/CCY qXhBI9m7T+8G/QK2FpC5VB6fb2kTigSiyVhiKrlckPkdpXRQAvNPx3HtSEBFd11O44FZm wfycwiQW4p7yveePeGxs4KpzQioWacDv4R9CHghupvs0K9yzLmZRaCMZAv9rV81PqTuz0 KR3GzLXMevCIK0KwpxI5dJGTjgK2HKeCMe97LEb3lM+KlHkE7MwlGnDgPmZuTr8EF+sUs /h27bxx030IlIB1yeYCwVrfu9rWfD5HB6VwPfxluQv6MZ0rL9cAUaRzH/SfHrDaec5g== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795162974; h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc: Date:Message-ID:In-Reply-To:References:X-sashiko-severity: Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version; bh=3vWMBt0s/L/45awvvzkr2FzxSFl2LojKDoemfm2EGkY=; b=Kbwsx0ZcfidYquMlKc71y62EZ7HfNcNE/scCc+8ok31NXARPcHDe+7TiCUiXnL7PSTXc 2lk9HqLQKuZr+9rgO1POEgXqsdvgWFbLLT2cc+bjuHTGeB9r927vea8yfCBL1XXKbcXcM 6WsktwUIq513I7G1mtgk5IZAkaVNIoYrTs0si6JIoX4sMN8p0Bhtk/VLjzWqovDZEl56Y 9gyh2uVGNb1jH1izMvIYcnsOLBM1Hg1tugDwjXmquPtthVOSAREnG/xJ8dgNXv6mmgUn7 aoJNmtnGIuZ5l4/fIm6XWBWJLwLfPS0+No0kL9rjjczFaWgDi8yDguMWFIBAYrmNvXA== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=lxZ0cHOR; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4F25C606A33F; Fri, 20 Nov 2026 08:22:54 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=lxZ0cHOR X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795162973; b=5f18B5yKGTL+i8dBuMvF+KzrzUNTKoTo7Ze/cOL1znQ2oZwd3RQ8taGp2na0HgLw4enR nRQHurtEnDGCwWOs7IXs62g7KyZBq8tWMOpwKPH1VFMSo8XhG7mzwRK3mhyJx1iz9fDcc 0LVYhJhI5MR1OtgYYpFrMh8DvJSWuhbmjd3/JoeZKg7of5yNvImK3Mvq/CFAesiG1zYyA nOQt4Y0vqg+++KW04GTNKXM+TQQOrX0GD3h+d0a5ifW4AiO4ybfAmUuck9f7gV2ayAVAy OgljEmGsCeJl82dIEv8hYa4mWnr8L0Z5NAft7A2j6dQx5a7VBx2jA4sHbK2kMV96Pnw== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795162973; h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID: In-Reply-To:References:X-sashiko-severity:Content-Type: Content-Transfer-Encoding:MIME-Version; bh=3vWMBt0s/L/45awvvzkr2FzxSFl2LojKDoemfm2EGkY=; b=3sw0k2nVLeBrNtTgDV62AptE5WdXQEixKLILQXUe8BF9CttuXaZ4TYEYSAdifcOoR2N+ SxUw4+uXIB4bNR7rX5JqnbrNKg85VnA2yaDUmu3q9otWsFvL6D70jhs/B4EeN95vD0Ca9 mS9+6iwi4GbxRRodPFwIq66wRBi962ywsV/zOITcvirJHcI6uyH6LfwgGeGvkOjiM0Frc Ph00RK064GyC93oJgiN1ln7Fe9CVkIPxebBnWW2/zx1yxE3W/+8A1mkOcn4uqRKv4I9X4 3Jce5XNG3dKTMX6MOfbjtJrtiJ+MVlnDUuwwiJHHUmu6dkgd76nNqoh9ILZaQbAwnDw== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=lxZ0cHOR; arc=none smtp.remote-ip=100.103.45.18 X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6F2F0606A325; Fri, 20 Nov 2026 08:22:53 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 91A211F000C4; Fri, 20 Nov 2026 08:22:52 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795162973; bh=3vWMBt0s/L/45awvvzkr2FzxSFl2LojKDoemfm2EGkY=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=lxZ0cHOR8stjKP+qY7bf5HLLBB87DkJUoGITtpsHZLcoA1an6lssiwvt9sJFRa1oA eaEaACc0NOTh6FRUcpFo7fj30gqeyx246AapVEDcBkRUSyRRuwCPjUtpdU+lVIwWgF ZbenfpMyAnoONYY/WNISsMehroEet3P0wnkgnGr0Y3OWaskJtH3JWScW/niaFFDN9B F/mFh6vEtSKMb/AXUeS8m7Lk6qo7p8PjVhNifLXTlj20qWfsAfedl8dbNetEdG/fSn hn0JT/QZoDCn1X9lLY609Y2bBxdJbkyjnRwo/rsR8okLqCfURoPt3BNnuxpVVXhGde gHISol2R1S4Wg== X-Cc: netdev@vger.kernel.org, mptcp@lists.linux.dev, edumazet@kernel.org, ncardwell@google.com, kuniyu@google.com, davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com, horms@kernel.org, matttbe@kernel.org, martineau@kernel.org, geliang@kernel.org X-In-Reply-To: <20261117052200.1507847-2-llleigoing@outlook.com> X-sashiko-severity: Low X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list