Skip to content

Commit 3be7f87

Browse files
author
Mrunal Patel
committed
Merge pull request #334 from hqhq/hq_set_cpus_mems_first
Set cpuset.cpus and cpuset.mems before join the cgroup
2 parents 7a95a53 + be67645 commit 3be7f87

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

libcontainer/cgroups/fs/cpuset.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,17 +59,16 @@ func (s *CpusetGroup) ApplyDir(dir string, cgroup *configs.Cgroup, pid int) erro
5959
if err := s.ensureParent(dir, root); err != nil {
6060
return err
6161
}
62-
// because we are not using d.join we need to place the pid into the procs file
63-
// unlike the other subsystems
64-
if err := writeFile(dir, "cgroup.procs", strconv.Itoa(pid)); err != nil {
65-
return err
66-
}
67-
6862
// the default values inherit from parent cgroup are already set in
6963
// s.ensureParent, cover these if we have our own
7064
if err := s.Set(dir, cgroup); err != nil {
7165
return err
7266
}
67+
// because we are not using d.join we need to place the pid into the procs file
68+
// unlike the other subsystems
69+
if err := writeFile(dir, "cgroup.procs", strconv.Itoa(pid)); err != nil {
70+
return err
71+
}
7372

7473
return nil
7574
}

0 commit comments

Comments
 (0)