Skip to contentSkip to conversation

cgroup: explicitly init the early_init field

PATCH NAK Jianyu Zhan 2 participants 3 messages Apr 22, 2014 cgroup

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cgroup: explicitly init the early_init field

For a cgroup subsystem who should init early, then it should carefully take care of the implementation of css_alloc, because it will be called before mm_init() setup the world.

Luckily we don't, and we better explicitly assign the early_init field to 0, for document reason.

---
 kernel/cgroup.c | 1 +
 1 file changed, 1 insertion(+)
kernel/cgroup.c +1 -0
index 559f822..f23cb67 100644
@@ -5325,5 +5325,6 @@ struct cgroup_subsys debug_cgrp_subsys = {
 	.css_alloc = debug_css_alloc,
 	.css_free = debug_css_free,
 	.base_cftypes = debug_files,
+	.early_init = 0,
 };
 #endif /* CONFIG_CGROUP_DEBUG */
Signature · 1 line
2.0.0-rc0
#1 lore raw
Quoted 7 lines · Jianyu Zhan

For a cgroup subsystem who should init early, then it should carefully take care of the implementation of css_alloc, because it will be called before mm_init() setup the world.

Luckily we don't, and we better explicitly assign the early_init field to 0, for document reason.

If you think this is the right thing to do, you can apply the same reason to the initialization of other structures in the whole kernel tree.

Quoted 1 line

nack

Quoted 16 lines
---
 kernel/cgroup.c | 1 +
 1 file changed, 1 insertion(+)
kernel/cgroup.c +1 -0
index 559f822..f23cb67 100644
@@ -5325,5 +5325,6 @@ struct cgroup_subsys debug_cgrp_subsys = {
 	.css_alloc = debug_css_alloc,
 	.css_free = debug_css_free,
 	.base_cftypes = debug_files,
+	.early_init = 0,
 };
 #endif /* CONFIG_CGROUP_DEBUG */
#2 lore raw
Quoted 6 lines · Li Zefan

If you think this is the right thing to do, you can apply the same reason to the initialization of other structures in the whole kernel tree.

Quoted 1 line

nack

Hi, Li,

Sorry for the noise.

For cpuset subsystem, this filed is nonzero; for other subsystems, this is zero. Actually none of these subsystem will change this field, I just thought that this is a little subtle. as the comment in patches says, this is mainly for
document reason to inform other maintainers that css_alloc implementation should be
taken care of , depending on this field is zero or not.

Thanks,
Jianyu Zhan