cgroup: explicitly init the early_init field
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
@@ -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
Li Zefan
NAKQuoted 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 beforemm_init()setup the world.Luckily we don't, and we better explicitly assign the
early_initfield 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
Signed-off-by Jianyu Zhan <[email protected]>
nack
Quoted 16 lines
--- kernel/cgroup.c | 1 + 1 file changed, 1 insertion(+)kernel/cgroup.c +1
-0@@ -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 */
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
Signed-off-by Jianyu Zhan <[email protected]>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