Skip to contentSkip to conversation

cgroup: update comment about dropping cgroup kn refs

PATCH Applied Haorui He 3 participants 4 messages Jan 12, 2025 – Jan 13, 2025 cgroup

lore
Share & tools
lore

Haorui He

author
#0 lore raw

PATCH 1/1 cgroup: update comment about dropping cgroup kn refs

the cgroup is actually freed in css_free_rwork_fn() now the ref count of the cgroup's kernfs_node is also dropped there so we need to update the corresponding comment in cgroup_mkdir()

---
 kernel/cgroup/cgroup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/cgroup/cgroup.c +1 -1
index d9061bd55436..805764cf14e2 100644
@@ -5835,7 +5835,7 @@ int cgroup_mkdir(struct kernfs_node *parent_kn, const char *name, umode_t mode)
 	}
 
 	/*
-	 * This extra ref will be put in cgroup_free_fn() and guarantees
+	 * This extra ref will be put in css_free_rwork_fn() and guarantees
 	 * that @cgrp->kn is always accessible.
 	 */
 	kernfs_get(cgrp->kn);
Signature · 1 line
2.47.1
maintainer
#1 lore raw

Hello Haorui.

Quoted 3 lines · Haorui He

the cgroup is actually freed in css_free_rwork_fn() now the ref count of the cgroup's kernfs_node is also dropped there so we need to update the corresponding comment in cgroup_mkdir()

It seems you've read through the comments recently.
Do you have more up your sleeve? (So that it could be grouped in one comments changeset.)

Thanks,
Michal

author
#2 lore raw

Hello Michal.

Quoted 3 lines · Michal Koutný

It seems you've read through the comments recently.
Do you have more up your sleeve? (So that it could be grouped in one comments changeset.)

No, I have not find more right now. I'm just reading the cgroups code and happen to be confused by that comment. I'm still reading about the cgroups code base though, so I'm not sure whether I will find more places that need to be updated.

Thanks,
Haorui He

maintainer Applied
#3 lore raw
In reply to Haorui He
Quoted 5 lines · Haorui He

the cgroup is actually freed in css_free_rwork_fn() now the ref count of the cgroup's kernfs_node is also dropped there so we need to update the corresponding comment in cgroup_mkdir()

Applied to sched_ext/for-6.14.

Thanks.

Signature · 1 line
tejun