From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796334717; b=3YOPYF3wQJgsT9r08K87QLZRNs2iWR25VjIibru8IeXyqMNoFUaBa3VBCRT9Hz+CljK9 +kShbX7k5tHoin3OSbYfkc+ZSweujoN4B5gNZS0efsIzOzZ/OX1FRomikRF3w/dTe0zJH 9RXl1CHUeIDOMvyFpV39WteDNn1jyCVG98BfG8wfQf70Y1S+Cbp0dZ2vtqTwgK6EC5JpG fprsbJ6VHhhPV0N1E/pUnoN/eLinwDPFdiQEAepQoI1BmT2vF0xnHDbxeLayzRWy6cKz8 Gh7knaiWn4BszoGE6Pti6xC07T3XUnWGFlUDPImi2YVHK2jbUQYYll9JaEziCi6Ltyw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796334717; 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=emWUqLKxWAqrUoAwCctTmJmedWRlM+xHsCr0ozIeTvg=; b=BMCPRR+T5LxaKABLcxw8WM4r6jMSLPOtSHX0sA3NwJZo+Gb5oyBZvDs7YQzbN8cXJDI5 3DP2wTUUUXeRH7HZfdEbZE4C1n6OGGfi57TtUGCXArsE3GE+fP+Fdsh+Yrr2nLpfHw1hY GLnA2wmAkX3sxugZ7xud5hq2vkuvOd5Er5cRNDvGlRJ24ZUbLd4CSFvibt5PS6FX+kesC 7NQGcUkH4+bryA90wEijy98oxN0LneddtCpbaX0ZIn48hfQyXjsaTYqks0wjliPuVvYwo 0kxuB5u7G4fM4GPt958ezaeZuHhkLBJzPhGi8vTInqx5HVc9ILp3ZxJ92m5XyPVQabQ== 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=KE32cS4F; arc=none smtp.remote-ip=100.103.45.18 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 62A02606A322; Thu, 3 Dec 2026 21:51:57 +0000 (UTC) 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=KE32cS4F Received: by smtp.kernel.org (Postfix) with ESMTPSA id 62A811F000CE; Thu, 3 Dec 2026 21:51:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796334717; bh=emWUqLKxWAqrUoAwCctTmJmedWRlM+xHsCr0ozIeTvg=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=KE32cS4FMwArPq56j/xuM/eYjdbEVEKesCepWUorcI+VOY0H8sZeImhRoM9MEW4Zk bFdUioVjODoMsVl8lsva0ZP00bLw6cVf7qdioZYcAc2qJbzI/+aZ+RlqRIQJRF0/VK DemAf5GkYaMncUzZHhpMtexz0FU2GyGxOVwBzOWY2F4BbYi7N8TligoemhI7CPabTR IlrUOIAevonmyU0R9i0son0D7d5knQ+8i69a6OuREQODY7z403/m5hGZCYaNKnvs6t gwD54t14sKoirUNTVEvjuWgDkOu9FFjqXl6I88NaCbqtQnaIGbShCWLUrANSmQ5Jae V2rgTnUJeTS2w== Subject: Re: [PATCH net 7/9] mptcp: reclaim forward memory after coalescing skbs From: netdev-bot+sashiko@kernel.org To: matttbe@kernel.org Cc: martineau@kernel.org, geliang@kernel.org, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, willemb@google.com, horms@kernel.org, dcaratti@redhat.com, netdev@vger.kernel.org, mptcp@lists.linux.dev, mason@kernel.org, stable@vger.kernel.org Date: Thu, 03 Dec 2026 21:51:55 +0000 Message-ID: <179633471597.3146.16650809270259188045@kernel.org> In-Reply-To: <20261202-net-mptcp-misc-fixes-7-4-rc7-v1-7-9f03efcb1a17@kernel.org> References: <20261202-net-mptcp-misc-fixes-7-4-rc7-v1-7-9f03efcb1a17@kernel.org> X-sashiko-severity: Low Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit 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 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] After this patch, mptcp_try_coalesce() in net/mptcp/protocol.c has two comments next to each other that disagree about the 'from'… -- mptcp: reclaim forward memory after coalescing skbs When an MPTCP socket takes an skb from a subflow, mptcp_borrow_fwdmem() credits skb->truesize to the msk forward allocation. Only part of that credit moves to sk_rmem_alloc when the skb is coalesced or condensed, so the rest builds up in sk_forward_alloc. This patch adds sk_mem_reclaim() calls in mptcp_try_coalesce() and mptcp_data_queue_ofo() to release that leftover memory. > diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c > index e89ed0b1e4218..8649e739ae500 100644 > --- a/net/mptcp/protocol.c > +++ b/net/mptcp/protocol.c > @@ -196,6 +196,9 @@ static bool mptcp_try_coalesce(struct sock *sk, struct sk_buff *to, > sk_mem_charge(sk, delta); > kfree_skb_partial(from, fragstolen); > > + /* release what is left of the borrowed 'from' truesize */ > + sk_mem_reclaim(sk); > + [Severity: Low] This isn't a bug, but after this change the two comments in mptcp_try_coalesce() disagree about the 'from' skb. Each one is wrong for one kind of caller. The existing comment just above says: /* note the fwd memory can reach a negative value after accounting * for the delta, but the later skb free will restore a non * negative one */ For the borrowed callers, __mptcp_move_skb() and mptcp_data_queue_ofo() via mptcp_ooo_try_coalesce(), mptcp_subflow_lend_fwdmem() has cleared from->destructor. mptcp_borrow_fwdmem() has also already added from->truesize to sk_forward_alloc. Since delta can't exceed from->truesize, sk_mem_charge(sk, delta) can't push the forward allocation negative. kfree_skb_partial() also runs no destructor, so the later free restores nothing. That is the reason this patch needs the explicit sk_mem_reclaim(). The new comment assumes 'from' is always borrowed. That doesn't hold for __mptcp_ofo_queue(): if (!tail || !mptcp_ooo_try_coalesce(msk, tail, skb)) { On that path 'from' is an out-of-order queue skb. skb_set_owner_r() already gave it sock_rfree at the end: label of mptcp_data_queue_ofo(), so kfree_skb_partial() ends up calling sock_rfree()->sk_mem_uncharge(). That already returns from->truesize and reclaims. There the old comment is the accurate one, and the new reclaim is redundant but harmless. mptcp_drop() states this borrowed vs owned split explicitly: if (!skb->destructor) sk_mem_reclaim(sk); Could the comments in mptcp_try_coalesce() be updated to cover both cases? For example, drop the stale "later skb free will restore" text and say the reclaim is needed for borrowed skbs that have no destructor. > return true; > } > [ ... ] -- Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261202-net-mptcp-misc-fixes-7-4-rc7-v1-0-9f03efcb1a17%40kernel.org