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/2026…%40kernel.org