0

1、I try to use CLONE_INTO_CGROUP flag to Clone a task into a specific cpuset cgroup, then I found the child's cpuset is correct, but the real properties(task_struct->cpus_mask for me) are inherited from the parent process.It's not what I expected.

static void cpuset_fork(struct task_struct *task)
{
    if (task_css_is_root(task, cpuset_cgrp_id))
        return;

    set_cpus_allowed_ptr(task, current->cpus_ptr);
    task->mems_allowed = current->mems_allowed;
}

This code doesn't seem to have considered the CLONE_INTO_CGROUP flag; is it a bug?

the information of CLONE_INTO_CGROUP is very little,may i use it with wrong way?

honor
  • 1
  • You should share the source code snippet which calls clone(). – Rachid K. Jul 10 '23 at 13:12
  • I don't use clone(). In fact,I keep a pointer to a specific group(CLONE INTO) and simulated the logic of CLONE_INTO_CGROUP, which looks like this struct cgroup *cgrp; cset = task_css_set(current); kargs->cset = find_css_set(cset, cgrp); in cgroup_css_set_fork() – honor Jul 11 '23 at 07:39

0 Answers0