MPTCP Linux Development
 help / color / mirror / Atom feed
From: Paolo Abeni <pabeni@redhat.com>
To: mptcp@lists.linux.dev
Subject: [PATCH mptcp-net 0/3] mptcp: fix memcg accounting for passive sockets
Date: Fri,  7 Nov 2025 22:55:44 +0100	[thread overview]
Message-ID: <cover.1762551942.git.pabeni@redhat.com> (raw)

It turns out that the splat reported earlier is indeed due to an old
bug/missing feature that hit hard on top of "mptcp: borrow forward 
memory from subflow", as we can borrow accounted memory from a socket
not doing any accounting;)

It should land upstream before the above mentioned commit, ence the
'net' target, but it could as well be net-next material.

I think there is still a racing window to produce the splat reported in
#597: if a subflow receive data while the msk is locked, and before the
memcg is initialized on such subflow, it will push the data into the msk
becklog, and later borrow will again try to grab accounted memory from
non accounting ssk.

I have a tentative fix for that one but it's quite ugly and I'll keep it
separate from this series.

Paolo Abeni (3):
  net: factor-out _sk_charge() helper
  mptcp: factor-out cgroup data inherit helper
  mptcp: fix memcg accounting for passive sockets

 include/net/sock.h   |  2 ++
 net/core/sock.c      | 18 ++++++++++++++++++
 net/ipv4/af_inet.c   | 17 +----------------
 net/mptcp/protocol.c | 36 ++++++++++++++++++++++++++----------
 net/mptcp/protocol.h |  3 +++
 net/mptcp/subflow.c  | 30 ++++++++++++++++++++++--------
 6 files changed, 72 insertions(+), 34 deletions(-)

-- 
2.51.0


             reply	other threads:[~2025-11-07 21:56 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-07 21:55 Paolo Abeni [this message]
2025-11-07 21:55 ` [PATCH mptcp-net 1/3] net: factor-out _sk_charge() helper Paolo Abeni
2025-11-11  7:24   ` Geliang Tang
2025-11-11 17:38   ` Matthieu Baerts
2025-11-12  9:04     ` Paolo Abeni
2025-11-12  9:16       ` Matthieu Baerts
2025-11-12  9:28         ` Paolo Abeni
2025-11-12  9:55           ` Matthieu Baerts
2025-11-07 21:55 ` [PATCH mptcp-net 2/3] mptcp: factor-out cgroup data inherit helper Paolo Abeni
2025-11-11  7:24   ` Geliang Tang
2025-11-07 21:55 ` [PATCH mptcp-net 3/3] mptcp: fix memcg accounting for passive sockets Paolo Abeni
2025-11-11  8:37   ` Geliang Tang
2025-11-11 17:25     ` Matthieu Baerts
2025-11-12  9:10       ` Paolo Abeni
2025-11-08 15:15 ` [PATCH mptcp-net 0/3] " MPTCP CI
2025-11-11 17:26 ` Matthieu Baerts
2025-11-12  9:35   ` Paolo Abeni
2025-11-12  9:58     ` Matthieu Baerts
2025-11-12 10:10 ` Matthieu Baerts

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=cover.1762551942.git.pabeni@redhat.com \
    --to=pabeni@redhat.com \
    --cc=mptcp@lists.linux.dev \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox