Merge pull request #86 from ktraghavendra/85_container_swappiness
Treat -1 as default value for memory swappiness
This commit is contained in:
commit
5ec11a2918
|
@ -75,6 +75,10 @@ func (s *MemoryGroup) Set(path string, cgroup *configs.Cgroup) error {
|
|||
if err := writeFile(path, "memory.swappiness", strconv.FormatInt(cgroup.MemorySwappiness, 10)); err != nil {
|
||||
return err
|
||||
}
|
||||
} else if cgroup.MemorySwappiness == -1 {
|
||||
return nil
|
||||
} else {
|
||||
return fmt.Errorf("invalid value:%d. valid memory swappiness range is 0-100", cgroup.MemorySwappiness)
|
||||
}
|
||||
|
||||
return nil
|
||||
|
|
|
@ -511,6 +511,10 @@ func joinMemory(c *configs.Cgroup, pid int) error {
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
} else if c.MemorySwappiness == -1 {
|
||||
return nil
|
||||
} else {
|
||||
return fmt.Errorf("invalid value:%d. valid memory swappiness range is 0-100", c.MemorySwappiness)
|
||||
}
|
||||
|
||||
return nil
|
||||
|
|
Loading…
Reference in New Issue