We no more rely on the cgroup's parent subtree_control file to verify
if a controller is enabled for a cgroup. So, populate the leaf/child
cgroups with subtree_control file similar to the parent cgroup.
Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
void InitChildDir(const char dirname[])
{
char tmp_path[FILENAME_MAX] = {0};
+ FILE *f;
int ret;
/* create the directory */
PARENT_DIR, dirname);
ret = mkdir(tmp_path, MODE);
ASSERT_EQ(ret, 0);
+
+ snprintf(tmp_path, FILENAME_MAX - 1,
+ "%s/%s/cgroup.subtree_control", PARENT_DIR, dirname);
+
+ f = fopen(tmp_path, "w");
+ ASSERT_NE(f, nullptr);
+ fprintf(f, "cpu io memory pids\n");
+ fclose(f);
}
void InitMountTable(void)