From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.82.181 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795934281; b=ZLzPe8AbV2tLfjA6YA4JRqcYzJZfM0N5GV1cl6BL4UiOO4Rt9+arKocNd15GUEN/Sopn IZkFAADVebbqQk4uIDsEm5Df1tvRQXQhNIcRNunWTGtySzEvW/ZjfmSWOeOk15tjvSJfv aF9Lh0suad5Emebr+8+PIf8dwjxJvd0Fi5hWnQ9HNEC3WQaJ71UN9qiQ5cThoFZBq2Elq 55UqvJbRKgqtg/X09u1YCkNSrrnzRlGTw7NkP49gqm88d3KzwNwfxvwrHorjr5xlvxWss qkEjAEcIyO0HJZR5anwpY1kpGTMfs2M+Dpdp/6fn31947RS4sgFFrL/NDiLULlevSbw== 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-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=uBbFK0c68ZQW4sPNTQEe+C6LhhmSLRk7LnUXOh2/htBUocsTFOiTXyqWXNdOpfCfpxCb KpoTRvYsx5CnSrei9Wa081vV1A/RGXLHc/XYGUXKc6dRU1h8+Ew0o++wlump+uvTr3dOf 50CzhnSM7CxTDIxoEw7cq0CKT0jsYBNZdeZ2D22krLgsfhZnnT5e2Gs6vqup5FWC5geGf dI8uVvFe/rgdIjZ8wDE2Sa/qPlw9rTkJv0+hyDbBu0iZHY9oCIVoZjNyVGDDjG/3ZQbk8 lEpwWxOqGUgvrxxaacLJvRwYDYf0AxuQyR2j9dNGJo6He0L38Dota/nNY8aFy1bHrJQ== 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=dpv3rvd5; arc=none smtp.remote-ip=74.125.82.181 Received: from mail-dy1-f181.google.com (mail-dy1-f181.google.com [74.125.82.181]) (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 A072B606A31C for ; Sun, 29 Nov 2026 06:38:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org A072B606A31C 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=dpv3rvd5 Received: by mail-dy1-f181.google.com with SMTP id 5a478bee46e88-386c4d2e2ccso8061317eec.0 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=vger.kernel.org; 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=dpv3rvd5eflaK0MZ46m+bAk67JclpZI0221zmAFPofND6meaD/X8E2kYapGDGTOO71 o7+iCXeNoL3XEk7XEa0ftjo+a9K5SYL5/IAay4U7GEv9yfzp/PiLN/ul7Bk3zOdPCe09 G2VylMH1oG3cXxLyzqs6LKZkhB7EGLkyVNBSbxFHSs/gNfIYg0sZyC6MWmsMRepW13+i iebietJ4IlPx7u5NDiwY64Emubi4A+lOduWSnySr0hAo1om+1Lor1XQhJ5Djgp7SgRVg d0F9aHVljsbKpOwDdV8Q0leJmF9J4FGZ/dtUkt4h+xUdr8P/7cuuTrv1w2G4ULlimqX/ 8tcw== 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=oYfIBD9rjOo014/a7JoZ0/klRTI9q3+cNCAcTdOhrAUpgM5VmmfSvsxhRUVsm+ZqC0 leqPgB3eKNGi3qKMF0sQCa+qmcomCON33NKoarOh7Tz0IF5hbM3aNxOZnbEUsWzh31Wq GTPvc48vkxG/uTlU7niCUfmmZ53GSlmutsmsKoXQoTaoTdCp2LUXfydVXWG1o+HhrTZC +xJ4Ljxr3pzGpvzIrMusbB5WehVEGPq/LvO7oY6ydEjhc0Nxo8LRBA8IbXAAV0hXTtuT /oCQE4QnCgbqe1RHr6TYbgqHbbrGC2FizGSq/Hab+M4Bad2WSF3M4gquzpUEV8e5Ty8w q1mQ== X-Gm-Message-State: APuU4Z/5TBG1Te87kN8/4kRNNdz6zv4v1Qg+JQWUy+uJwW4mEHOW2kSH hAPJg2eeV5XAf2B7Ae7Oi40vvmbnd3ewZxWl7el1i5AuM8wwFGc0EvoY X-Gm-Gg: AZFdTZeRyCnr/lNDq7qgzpOUF7n0tr7/ivU/GL9UPHHf1i4dN1XzXmC+4XgacbmIjZN 7dUfx38tCrtxqzm/ekzLBbJwrywNRzevI01z8qLiBrigbcK4dA0TCDhT5VDTaONRh0wraLHCuvj N8o9uGWeaxBRkSad/ePHyQIyNxfP50Jsj3KIDBO1f6GvLHZs6EjKStfqy6yOFPbPVrKy2/sWvqn /iFr5E8AMEO2XYsYEddRVlP1jIR2nBfOAWrOzKrz4T7bRuN1Plc2EMElTFU2UuyQjaJW/S/q8iv L/N3CQPvC7OEX0IQlMIJN5raJi7T5L4+OaXecMMBEcfQGrRKHUCyo/EndLdP99jd5ntUwPueRe1 2gUdvA5+pOcfvdTu2WdGGzNdHvzsJYto2tDWRRskEN1V9NRKiSmyW1IPJuqLDzXGiJOXgYv+40o KXF0yHKiOcucuTQrjYIys+wIuUG3yKrBERxH4phgETskMfDBIuQ5WfCLEal6ihlClxIMLJ3dmsh mqs9k7FqZ7qA4Z3S3BjIvgtbVS0W+7w/BxI4fK37U6CBu8+dATMgXQds+8cYv0MbtKdC95igoM7 2Yq6Qg3x9Ma9fTZRxNS30VE+Fx/OTY0yjqVfLsOm9Mpmcg== 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: netdev@vger.kernel.org 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