All Virtuozzo development lists (kernel + QEMU)
 help / color / mirror / Atom feed
From: no-reply@sashiko.virtuozzo.com
To: Eva Kurchatova <eva.kurchatova@virtuozzo.com>,
	khorenko@virtuozzo.com, vladimir.riabchun@virtuozzo.com
Cc: devel@openvz.org
Subject: Re: [Devel] [PATCH hci-8.2 8/9] ms/mptcp: borrow forward memory from subflow
Date: Thu, 19 Nov 2026 05:03:09 +0000	[thread overview]
Message-ID: <010701a1f22fed1c-ad7957b7-368f-4aea-9b57-3b303ae8af2a-000000@eu-central-1.amazonses.com> (raw)
In-Reply-To: <20261119044702.1218722-9-eva.kurchatova@virtuozzo.com>

Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [Low] mptcp: vacuous DEBUG_NET_WARN_ON_ONCE in mptcp_borrow_fwdmem()
- [Low] mptcp: commit message claims RCVPRUNED MIB and last drop
  removed, but both remain
--

commit ab2d16826da729da089390db8fdf38dd6e2d8ff6
Author: Paolo Abeni <pabeni@redhat.com>

ms/mptcp: borrow forward memory from subflow

This replaces skb_orphan() in the MPTCP receive path with helpers that lend
the skb's forward memory from the subflow and borrow it on the msk. The
subflow's leftover page fragment is borrowed when the subflow is closed.

Link: https://patch.msgid.link/20251121-net-next-mptcp-memcg-backlog-imp-v1-12-1f34b6c1e0b1@kernel.org

> This allow removing the last drop in the TCP to MPTCP transition and the
> associated, now unused, MIB.

[Severity: Low]
Is this sentence true for this tree? After this patch __mptcp_move_skb()
still does this:

	if (!mptcp_try_rmem_schedule(sk, skb)) {
		MPTCP_INC_STATS(sock_net(sk), MPTCP_MIB_RCVPRUNED);
		goto drop;
	}

MPTCP_MIB_RCVPRUNED is also still incremented in mptcp_data_queue_ofo().
Only the sk_rmem_schedule() check and its counter increment were removed.
The rebase note explains the divergence from mainline, but the sentence
itself is wrong here. The last patch of the series still has the MIB and
both increments. Could the sentence be dropped or reworded?

> diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h
> index 282176fe111d..51a8a3357e2d 100644
> --- a/net/mptcp/protocol.h
> +++ b/net/mptcp/protocol.h

[ ... ]

> +static inline void mptcp_borrow_fwdmem(struct sock *sk, struct sk_buff *skb)
> +{
> +	struct sock *ssk = skb->sk;
> +
> +	/* The subflow just lend the skb fwd memory, and we know that the skb
> +	 * is only accounted on the incoming subflow rcvbuf.
> +	 */
> +	DEBUG_NET_WARN_ON_ONCE(skb->destructor);
> +	skb->sk = NULL;
> +	sk_forward_alloc_add(sk, skb->truesize);
> +	atomic_sub(skb->truesize, &ssk->sk_rmem_alloc);
> +}

[Severity: Low]
Can this DEBUG_NET_WARN_ON_ONCE() ever fire? Both callers,
__mptcp_move_skb() and mptcp_fastopen_subflow_synack_set_params(), call
mptcp_subflow_lend_fwdmem() right before this helper, and that helper sets
skb->destructor = NULL. The condition is therefore always false, so the
assertion cannot catch a misuse, while skb->sk is dereferenced without any
check. Would testing skb->sk here be more useful?

Carry the trailer below into the next revision and Sashiko will not review this patch again.

Reviewed-by: Sashiko <no-reply@sashiko.virtuozzo.com>

-- 
Sashiko AI review · https://sashiko.vzint.dev/#/patchset/20261119044702.1218722-1-eva.kurchatova@virtuozzo.com?part=8

_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

  reply	other threads:[~2026-11-19  5:05 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-19  4:35 [Devel] [PATCH hci-8.2 0/9] ms/mptcp: backport fixes for dropped stream segments Eva Kurchatova
2026-11-19  4:35 ` [Devel] [PATCH hci-8.2 1/9] ms/tcp: Save lock_sock() for memcg in inet_csk_accept() Eva Kurchatova
2026-11-19  4:53   ` no-reply
2026-11-19 17:08   ` Konstantin Khorenko
2026-11-19  4:35 ` [Devel] [PATCH hci-8.2 2/9] ms/mptcp: Fix up subflow's memcg when CONFIG_SOCK_CGROUP_DATA=n Eva Kurchatova
2026-11-19  4:52   ` no-reply
2026-11-19 17:08   ` Konstantin Khorenko
2026-11-19  4:35 ` [Devel] [PATCH hci-8.2 3/9] ms/net: factor-out _sk_charge() helper Eva Kurchatova
2026-11-19  4:53   ` no-reply
2026-11-19 17:08   ` Konstantin Khorenko
2026-11-19  4:35 ` [Devel] [PATCH hci-8.2 4/9] ms/mptcp: factor-out cgroup data inherit helper Eva Kurchatova
2026-11-19  4:54   ` no-reply
2026-11-19 17:08   ` Konstantin Khorenko
2026-11-19  4:35 ` [Devel] [PATCH hci-8.2 5/9] ms/mptcp: grafting MPJ subflow earlier Eva Kurchatova
2026-11-19  4:59   ` no-reply
2026-11-19 17:08   ` Konstantin Khorenko
2026-11-19  4:35 ` [Devel] [PATCH hci-8.2 6/9] ms/mptcp: fix memcg accounting for passive sockets Eva Kurchatova
2026-11-19  4:58   ` no-reply
2026-11-19 17:08   ` Konstantin Khorenko
2026-11-19  4:35 ` [Devel] [PATCH hci-8.2 7/9] ms/mptcp: handle first subflow closing consistently Eva Kurchatova
2026-11-19  4:59   ` no-reply
2026-11-19 17:08   ` Konstantin Khorenko
2026-11-19  4:35 ` [Devel] [PATCH hci-8.2 8/9] ms/mptcp: borrow forward memory from subflow Eva Kurchatova
2026-11-19  5:03   ` no-reply [this message]
2026-11-19 17:08   ` Konstantin Khorenko
2026-11-19  4:35 ` [Devel] [PATCH hci-8.2 9/9] ms/mptcp: reclaim forward-allocated memory on RX path errors Eva Kurchatova
2026-11-19  5:01   ` no-reply
2026-11-19 17:08   ` Konstantin Khorenko
2026-11-19 17:08 ` [Devel] [PATCH hci-8.2 0/9] ms/mptcp: backport fixes for dropped stream segments Konstantin Khorenko
2026-11-19 17:08 ` Konstantin Khorenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=010701a1f22fed1c-ad7957b7-368f-4aea-9b57-3b303ae8af2a-000000@eu-central-1.amazonses.com \
    --to=no-reply@sashiko.virtuozzo.com \
    --cc=devel@openvz.org \
    --cc=eva.kurchatova@virtuozzo.com \
    --cc=khorenko@virtuozzo.com \
    --cc=vladimir.riabchun@virtuozzo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.