Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.82.180 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795934281; b=2djkLHEMbcClEEDSjI9MLE034BPDCPvAhoYyomq3/9gfDgEAibgis6pWxntwXzb572az ENznlC3nbcFjOaKjIXCpQ0bQqRku2HUqoRDAb14GXhnVxzLwNWu6t+gEH0jvQ8o8K+jJA d2zpSAlhO0CxsDuzKSsdacoILd/QzntaAqXTO414QCCxeT3R0rOa1zDWef6/bcaxfyVFj dtBkVL+U6dwbt5/Kn4jY7+dpazWKgdDzDYK/O/ES3VfmeA546sXkLWhWNwzoG8nUIrb5R gAEb3MbVl4RlK8wLuoQyjjn+OfRkN2JvLJiiWhH0eOuB9q/xUW9LbGGl9pESiY9hkPg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795934281; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:To:Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To:References: MIME-Version:Content-Transfer-Encoding; bh=J9+el+YwJuwsrteKlF8ICnghurjaumqSjfwtkJi6y2U=; b=IcPeRAkWaw/bzQdHnF4ErgnFT8kBHdpwUydlMA/rPtZBBHqV1To1GT96jsrFSb4r90jL rLpLemeg4CoZnwsJvYEi5yfBY4SnO8lpOnesHFsEH8NTccNKiSyPpD1CVHcFmM7gsbP4h pPO1QhPew6j5rWpiZn7jQKUHaNwA4nBVd0tKpUxHMiCYZ7F8xRKDr/ZvrvAyomVv/38CL dFFzWxobHKNitsZ3z5XWNpOXNQRbDZeqapn3D9PBJfKBuPJwI41tX3Wwd6W2fpjp+fbKw gpPcmPe8W5qtbQFHBsRXTu6yq0M6wtzBHsRptPgG5Jn1V1fzCvhJGLC0uKrHTej1m1Q== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=doxpSCtj; arc=none smtp.remote-ip=74.125.82.180 Received: from mail-dy1-f180.google.com (mail-dy1-f180.google.com [74.125.82.180]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A6FAE606A323 for ; Sun, 29 Nov 2026 06:38:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org A6FAE606A323 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.a=rsa-sha256 header.s=20260707 header.b=doxpSCtj Received: by mail-dy1-f180.google.com with SMTP id 5a478bee46e88-38190551625so17846991eec.1 for ; Sat, 28 Nov 2026 22:38:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1795934280; x=1796539080; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=J9+el+YwJuwsrteKlF8ICnghurjaumqSjfwtkJi6y2U=; b=doxpSCtjwg/m1d5pq7hgf+iXmcWpD/1PLABoi9gOyXkndPD2W/FycSVVunkNYuAwXL nPedFwzgzSRclfSrU2qLcXfJM9RUQyedrHVtOgKkylYjufUrut0S5b4fivxcYsieGnYK GO1vc92gOuPQ/3Kxca9uotOOXpPeOPFEvIK5zjV8Gdlu+zssxM4xI4x8Qrzl9iCgnrJl Mvhy4s6aJqh9dNUjElE+g3/9UbVUevTSMoEnC2+O/+wf/G6kxZH2MZo0SUO5idXdsWBi BfXTbD1pVIYy9x5mV7Dd9wy5VaB21Cg3d+H8x7zxpHSTITrR3pA1GlNlzAHwOl5utZap 6FWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1795934280; x=1796539080; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=J9+el+YwJuwsrteKlF8ICnghurjaumqSjfwtkJi6y2U=; b=fiQKnoXzAArfKkZ9yeY2uEGJxZQuGHcidYx8IwwsoVU/YX2L1u2TA8FD+Gtc0FIfh3 U7g7tkkijLAaoxOiPc3p8LrbWZnuLPoY67Av6fipZgD590NkfNfz0AQdnBSuXJZu6gpY 7Hwi25NOj2PQ4iwjKOFXye3LadbqZ969veUIqnQGeL/we/LbR+lfBul1V5aGEM/rwuAI tWbTD9uCwbzhIxlLPP2WhgYM5zuIqPHaKgQsNyIfsQDdQ3GipHhBBwMEN3rIL74t+q/Z TSlkcWf1R2yKS78QO6vvwUMumRQ9XxLEy1pLAyRibJ3/IEfXm3LBvoeew+yI5VjN/3AG e0tw== X-Forwarded-Encrypted: i=1; AL+hErEEtE1+4hgjn+Cx3BC4yA+/v+KHy+pwRj85ya3djlyy4ncKA/dQp3YK88E8OrMOcd/T/IVThg==@lists.linux.dev X-Gm-Message-State: APuU4Z9Dhwz4s0i2wze40BmVFXkR14wxjFjQnnkS5Ss6yECH88McjrSo O6qMvqMUxRyM1jB31ITJNnptkxzQyDB9FrBASHxU6f//q3NAmzZouIvz X-Gm-Gg: AZFdTZdl/CMdEIvXVdEcLvpPfjmXsCFezI6RsmHTV2DBQiKWdMbgfCsUdzTy0t/6j+x N+CfEK1kKUh28vbbxp/OJsSn3ch8Rn0q1ylJ1mN8VY8VoI34iJdl1/D7jpIrIlBgpTZk4o5PuMY BEuKGQ1DeI9d1zogMPZSQ+g2KMd7rFsbsHkkN4a/FL8xa/nbo3EEj/ynS6Twz6MWyWzYOYOWF6a Wg/kMKjJ0m68ALK4PKQMnSBqvpJrS7Ov5+zq1K/rDQdFVPDEqLbG3HFifBAS5u63jHR5wIYoBFG nisAyBd1IWelV4WdD+Hco2InmbBpCSvv8Vd1QsDsX+2j/gP6CgRZHhos5Vf7Q3CLqBqO+K7Zb6L 3PCKnaGvVUFeXnPFmDhqt2aSfDHazN/0mQJiHUx+F5jW+M7wM4ZTg08LQ3ZGI9/I0olfv6782is pkbUPYyXQhE4zL+7uoXmbmWSREF7DBbzLyvGqj7/MlgMYCN4Y0ayal0Ks2F61TUk8K1TAVHeATT JL1Dntla78+MDGuRG7sUd5ddE2FAjEb/+fHAptGO+4QG6gM2almUdxB1hRUj5aSOwGEOUE3Q7NL RbCWIBpfJZ9r4Qycktd7X6BcRegUY1tRGpMDb55lZ7iZSQ== X-Received: by 2002:a05:7300:2301:b0:385:4c54:3c8c with SMTP id 5a478bee46e88-3856c0c9403mr42412175eec.1.1795934279524; Sat, 28 Nov 2026 22:37:59 -0800 (PST) Received: from localhost ([2605:52c0:1:e99:982a:f6ff:fe2e:6e83]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-386aa203267sm54282089eec.0.2026.11.28.22.37.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Nov 2026 22:37:59 -0800 (PST) From: Lin Lei To: Matthieu Baerts , Paolo Abeni , Eric Dumazet Cc: netdev@vger.kernel.org, mptcp@lists.linux.dev, netdev-bot+sashiko@kernel.org, ncardwell@google.com, kuniyu@google.com, davem@davemloft.net, kuba@kernel.org, horms@kernel.org, martineau@kernel.org, geliang@kernel.org, llleigoing@outlook.com Subject: Re: [PATCH net 2/3] net: bound receive window predictions before narrowing Date: Sun, 29 Nov 2026 06:37:54 +0000 Message-ID: <20261129063755.1972521-1-llleigoing@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <179516297347.3136.13553293180683672285@kernel.org> References: <20261117052200.1507847-1-llleigoing@outlook.com> <20261117052200.1507847-3-llleigoing@outlook.com> <179516297347.3136.13553293180683672285@kernel.org> X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Hi Matthieu, Paolo, Eric, Following up on the MPTCP subflow issue Sashiko flagged on patch 2/3: On Fri, 20 Nov 2026 08:22:53 +0000, netdev-bot+sashiko@kernel.org wrote: > Can this clamp turn an underflowed prediction into a fully saturated > subflow receive buffer? [...] > Before this patch, the u32 truncation gave an arbitrary result. With > newval == oldval / 2 the sum was exactly 2^33, so nothing changed. [...] > The subtraction was already there before this patch. Would it make sense > to skip the slow-start growth when newval <= oldval? Yes, this heterogeneous-subflow case (e.g. an MTU 1500 initial subflow and an MTU 9000 MP_JOIN subflow, with @copied landing between their rcvq_space.space values) can indeed happen: (newval - oldval) underflows and produces a bogus slow-start prediction. Cases like newval == oldval / 2 leaving sk_rcvbuf unchanged before v1 only happened by coincidence because 2^33 wrapped to 0 in u32 (in a local test of this MTU 1500 + 9000 setup on unpatched 7.4.0-rc2, a 30 KB read already sends the join subflow's sk_rcvbuf straight to tcp_rmem[2] and moves its rcvq_space.space backwards). Relying on 32-bit wraparound is not valid behavior; avoiding bogus growth here should be handled explicitly by the algorithm. If this seems worth addressing, I see two main options: 1) Option 1: Skip slow-start growth when newval <= oldval in tcp_rcvbuf_grow(), as Sashiko suggested. This avoids the underflow without affecting tcp_data_queue_ofo() (which passes newval == oldval), but pure TCP callers already guarantee newval >= oldval, and tp->rcvq_space.space = newval at the top of tcp_rcvbuf_grow() would still move the larger-MTU subflow's space estimate backwards. 2) Option 2: Keep tcp_rcvbuf_grow() unchanged and clamp the sample to at least the subflow's existing rcvq_space.space in MPTCP: diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c --- a/net/mptcp/protocol.c +++ b/net/mptcp/protocol.c @@ -2321,12 +2321,14 @@ static void mptcp_rcv_space_adjust(struct mptcp_sock *msk, int copied) mptcp_for_each_subflow(msk, subflow) { struct sock *ssk; bool slow; + int space; ssk = mptcp_subflow_tcp_sock(subflow); slow = lock_sock_fast(ssk); + space = tcp_sk(ssk)->rcvq_space.space; /* subflows can be added before tcp_init_transfer() */ - if (tcp_sk(ssk)->rcvq_space.space) - tcp_rcvbuf_grow(ssk, copied); + if (space) + tcp_rcvbuf_grow(ssk, max(copied, space)); unlock_sock_fast(ssk, slow); } } Personally, Option 2 seems cleaner to me: it fixes the issue at the only caller that can pass a smaller sample, preserves the subflow's existing space estimate, zeros the slow-start delta when copied < space, and still lets TCP account for its own OOO queue (per commit 6b329393502e) and low_rtt policy. What do you think? If this looks reasonable to you, I plan to submit a standalone patch. Thanks, Lin