cpuset_v2: skip Apply when no limit is specified
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
This commit is contained in:
parent
4e3701702e
commit
d918e7f408
|
@ -22,11 +22,14 @@ func (s *CpusetGroupV2) Name() string {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *CpusetGroupV2) Apply(d *cgroupData) error {
|
func (s *CpusetGroupV2) Apply(d *cgroupData) error {
|
||||||
|
if d.config.Resources.CpusetCpus == "" && d.config.Resources.CpusetMems == "" {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
dir, err := d.path("cpuset")
|
dir, err := d.path("cpuset")
|
||||||
if err != nil && !cgroups.IsNotFound(err) {
|
if err != nil && !cgroups.IsNotFound(err) {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
return s.ApplyDir(dir, d.config, d.pid)
|
return s.applyDir(dir, d.config, d.pid)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *CpusetGroupV2) Set(path string, cgroup *configs.Cgroup) error {
|
func (s *CpusetGroupV2) Set(path string, cgroup *configs.Cgroup) error {
|
||||||
|
@ -51,7 +54,7 @@ func (s *CpusetGroupV2) GetStats(path string, stats *cgroups.Stats) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *CpusetGroupV2) ApplyDir(dir string, cgroup *configs.Cgroup, pid int) error {
|
func (s *CpusetGroupV2) applyDir(dir string, cgroup *configs.Cgroup, pid int) error {
|
||||||
// This might happen if we have no cpuset cgroup mounted.
|
// This might happen if we have no cpuset cgroup mounted.
|
||||||
// Just do nothing and don't fail.
|
// Just do nothing and don't fail.
|
||||||
if dir == "" {
|
if dir == "" {
|
||||||
|
|
Loading…
Reference in New Issue