Merge pull request #334 from hqhq/hq_set_cpus_mems_first

Set cpuset.cpus and cpuset.mems before join the cgroup
This commit is contained in:
Mrunal Patel 2015-10-15 14:33:28 -07:00
commit 3be7f87b1b
1 changed files with 5 additions and 6 deletions

View File

@ -59,17 +59,16 @@ func (s *CpusetGroup) ApplyDir(dir string, cgroup *configs.Cgroup, pid int) erro
if err := s.ensureParent(dir, root); err != nil {
return err
}
// because we are not using d.join we need to place the pid into the procs file
// unlike the other subsystems
if err := writeFile(dir, "cgroup.procs", strconv.Itoa(pid)); err != nil {
return err
}
// the default values inherit from parent cgroup are already set in
// s.ensureParent, cover these if we have our own
if err := s.Set(dir, cgroup); err != nil {
return err
}
// because we are not using d.join we need to place the pid into the procs file
// unlike the other subsystems
if err := writeFile(dir, "cgroup.procs", strconv.Itoa(pid)); err != nil {
return err
}
return nil
}