mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-11 06:03:57 +08:00
be6764508e
It can avoid unnecessary task migrataion, see this scenario: - container init task is on cpu 1, and we assigned it to cpu 1, but parent cgroup's cpuset.cpus=2 - we created the cgroup dir and inherited cpuset.cpus from parent as 2 - write container init task's pid to cgroup.procs - [it's possibile the container init task migrated to cpu 2 here] - set cpuset.cpus as assigned to cpu 1 - [the container init task has to be migrated back to cpu 1] So we should set cpuset.cpus and cpuset.mems before writing pids to cgroup.procs to aviod such problem. Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>