Thread (15 messages) 15 messages, 5 authors, 2021-10-22

Re: [V2][PATCH] cgroup: fix memory leak caused by missing cgroup_bpf_offline

From: Alexei Starovoitov <hidden>
Date: 2021-10-22 21:29:38
Also in: bpf, cgroups, lkml

On Fri, Oct 22, 2021 at 4:56 AM Quanyang Wang
[off-list ref] wrote:
quoted
quoted
Fixes: 2b0d3d3e4fcf ("percpu_ref: reduce memory footprint of percpu_ref in fast path")
Fixes: 4bfc0bb2c60e ("bpf: decouple the lifetime of cgroup_bpf from cgroup itself")
Signed-off-by: Quanyang Wang <redacted>
---
V1 ---> V2:
1. As per Daniel's suggestion, add description to commit msg about the
balance of cgroup's refcount in cgroup_bpf_offline.
2. As per Michal's suggestion, add tag "Fixes: 4bfc0bb2c60e" and add
description about it.
3. Fix indentation on the percpu_ref_is_dying line.
Acked-by: Roman Gushchin <redacted>

The fix looks correct, two fixes tag are fine too, if only it won't
confuse scripts picking up patches for stable backports.

In fact, it's a very cold path, which is arguably never hit in the real
life. On cgroup v2 it's not an issue. I'm not sure we need a stable
backport at all, only if it creates a noise for some automation tests.

Quanyang, out of curiosity, how did you find it?
I ran ltp testsuite to find this.

./runltp -f controllers -s cgroup

Thanks,
Quanyang
quoted
Anyway, thanks for catching and fixing it!
Applied to bpf tree. Thanks everyone!
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help