From: Chen Ridong <chenridong@huaweicloud.com>
To: tj@kernel.org, lizefan.x@bytedance.com, hannes@cmpxchg.org,
longman@redhat.com, mkoutny@suse.com, john.fastabend@gmail.com,
roman.gushchin@linux.dev, quanyang.wang@windriver.com,
ast@kernel.org
Cc: cgroups@vger.kernel.org, linux-kernel@vger.kernel.org,
bpf@vger.kernel.org, chenridong@huawei.com,
wangweiyang2@huawei.com
Subject: [PATCH v1 1/2] Revert "cgroup: Fix memory leak caused by missing cgroup_bpf_offline"
Date: Fri, 18 Oct 2024 08:15:19 +0000 [thread overview]
Message-ID: <20241018081520.694139-2-chenridong@huaweicloud.com> (raw)
In-Reply-To: <20241018081520.694139-1-chenridong@huaweicloud.com>
From: Chen Ridong <chenridong@huawei.com>
This reverts commit 04f8ef5643bcd8bcde25dfdebef998aea480b2ba.
Only cgroup v2 can be attached by cgroup by BPF programs. Revert this
commit and cgroup_bpf_inherit and cgroup_bpf_offline won't be called in
cgroup v1. The memory leak issue will be fixed with next patch.
Fixes: 04f8ef5643bc ("cgroup: Fix memory leak caused by missing cgroup_bpf_offline")
Link: https://lore.kernel.org/cgroups/aka2hk5jsel5zomucpwlxsej6iwnfw4qu5jkrmjhyfhesjlfdw@46zxhg5bdnr7/
Signed-off-by: Chen Ridong <chenridong@huawei.com>
---
kernel/cgroup/cgroup.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c
index 044c7ba1cc48..30444e096027 100644
--- a/kernel/cgroup/cgroup.c
+++ b/kernel/cgroup/cgroup.c
@@ -2314,10 +2314,8 @@ static void cgroup_kill_sb(struct super_block *sb)
* And don't kill the default root.
*/
if (list_empty(&root->cgrp.self.children) && root != &cgrp_dfl_root &&
- !percpu_ref_is_dying(&root->cgrp.self.refcnt)) {
- cgroup_bpf_offline(&root->cgrp);
+ !percpu_ref_is_dying(&root->cgrp.self.refcnt))
percpu_ref_kill(&root->cgrp.self.refcnt);
- }
cgroup_put(&root->cgrp);
kernfs_kill_sb(sb);
}
--
2.34.1
next prev parent reply other threads:[~2024-10-18 8:23 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-18 8:15 [PATCH v1 0/2] Only cgroup v2 can be attached by bpf programs Chen Ridong
2024-10-18 8:15 ` Chen Ridong [this message]
2024-10-18 8:15 ` [PATCH v1 2/2] cgroup/bpf: only " Chen Ridong
2024-10-21 20:03 ` [PATCH v1 0/2] Only " Tejun Heo
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=20241018081520.694139-2-chenridong@huaweicloud.com \
--to=chenridong@huaweicloud.com \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=cgroups@vger.kernel.org \
--cc=chenridong@huawei.com \
--cc=hannes@cmpxchg.org \
--cc=john.fastabend@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lizefan.x@bytedance.com \
--cc=longman@redhat.com \
--cc=mkoutny@suse.com \
--cc=quanyang.wang@windriver.com \
--cc=roman.gushchin@linux.dev \
--cc=tj@kernel.org \
--cc=wangweiyang2@huawei.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®