Skip to content

mptcp: fix memcg accounting for passive sockets

Paolo Abeni mptcp 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 15 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3net: factor-out _sk_charge() helperinclude/net/sock.h net/core/sock.c net/ipv4/af_inet.c+21 -166 replies
2/3mptcp: factor-out cgroup data inherit helpernet/mptcp/protocol.h net/mptcp/subflow.c+14 -81 reply
3/3mptcp: fix memcg accounting for passive socketsnet/mptcp/protocol.c net/mptcp/protocol.h net/mptcp/subflow.c+37 -103 replies

Reviews trailers per patch

2 of 3 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchGeliang TangMatthieu Baerts (NGI0)
SeriesR-b
1/3R-b
2/3R-b
3/3

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH mptcp-net 0/3] mptcp: fix memcg accounting for passive sockets

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(-)
Signature · 1 line
2.51.0