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(-)
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
Hi Paolo, On 07/11/2025 22:55, Paolo Abeni wrote: > 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. As discussed on IRC, it is fine to already apply this series. Now in our tree, feat. for net-next, before "mptcp: cleanup fallback data fin reception". New patches for t/upstream: - d4e154d9235e: net: factor-out _sk_charge() helper (Note: I'm going to change the RvB tags to Acked-by: non MPTCP change) - c39f3876137b: mptcp: factor-out cgroup data inherit helper - ce0882b539e6: mptcp: fix memcg accounting for passive sockets - Results: 83290f9ea1dc..8ecdad1578d9 (export) Tests are now in progress: - export: https://github.com/multipath-tcp/mptcp_net-next/commit/ddd5885869f67ae638bb3c8db14dfc80a1fe2bfd/checks Cheers, Matt -- Sponsored by the NGI0 Core fund.
Hi Paolo, On 07/11/2025 22:55, Paolo Abeni wrote: > 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. Thank you for these fixes! They look good to me for 'net': Reviewed-by: Matthieu Baerts (NGI0) <matttbe@kernel.org> > 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. Good idea! Cheers, Matt -- Sponsored by the NGI0 Core fund.
On 11/11/25 6:26 PM, Matthieu Baerts wrote: > Hi Paolo, > > On 07/11/2025 22:55, Paolo Abeni wrote: >> 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. > > Thank you for these fixes! > > They look good to me for 'net': > > Reviewed-by: Matthieu Baerts (NGI0) <matttbe@kernel.org> If you don't have applied these patches yet, please wait a bit: I'll send a new revision including a minor delta to make 'Squash-to: "mptcp: leverage the backlog for RX packet processing"' smaller/less ugly. Thanks! Paolo
On 12/11/2025 10:35, Paolo Abeni wrote: > On 11/11/25 6:26 PM, Matthieu Baerts wrote: >> Hi Paolo, >> >> On 07/11/2025 22:55, Paolo Abeni wrote: >>> 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. >> >> Thank you for these fixes! >> >> They look good to me for 'net': >> >> Reviewed-by: Matthieu Baerts (NGI0) <matttbe@kernel.org> > > If you don't have applied these patches yet, please wait a bit: I'll > send a new revision including a minor delta to make 'Squash-to: "mptcp: > leverage the backlog for RX packet processing"' smaller/less ugly. I was going to apply them to help you not to have to carry many patches, but I can sure wait! :) Cheers, Matt -- Sponsored by the NGI0 Core fund.
Hi Paolo,
Thank you for your modifications, that's great!
Our CI did some validations and here is its report:
- KVM Validation: normal (except selftest_mptcp_join): Success! ✅
- KVM Validation: normal (only selftest_mptcp_join): Success! ✅
- KVM Validation: debug (except selftest_mptcp_join): Success! ✅
- KVM Validation: debug (only selftest_mptcp_join): Critical: KMemLeak ❌
- KVM Validation: btf-normal (only bpftest_all): Success! ✅
- KVM Validation: btf-debug (only bpftest_all): Success! ✅
- Task: https://github.com/multipath-tcp/mptcp_net-next/actions/runs/19194272317
Initiator: Matthieu Baerts (NGI0)
Commits: https://github.com/multipath-tcp/mptcp_net-next/commits/5451f3b28abd
Patchwork: https://patchwork.kernel.org/project/mptcp/list/?series=1021093
If there are some issues, you can reproduce them using the same environment as
the one used by the CI thanks to a docker image, e.g.:
$ cd [kernel source code]
$ docker run -v "${PWD}:${PWD}:rw" -w "${PWD}" --privileged --rm -it \
--pull always mptcp/mptcp-upstream-virtme-docker:latest \
auto-normal
For more details:
https://github.com/multipath-tcp/mptcp-upstream-virtme-docker
Please note that despite all the efforts that have been already done to have a
stable tests suite when executed on a public CI like here, it is possible some
reported issues are not due to your modifications. Still, do not hesitate to
help us improve that ;-)
Cheers,
MPTCP GH Action bot
Bot operated by Matthieu Baerts (NGI0 Core)
© 2016 - 2025 Red Hat, Inc.