OptionalSwap allows the memory controller to not fail if cgroups is not accounting Swap memory (there are no memory.memsw.* entries)
()
| 178 | // OptionalSwap allows the memory controller to not fail if cgroups is not accounting |
| 179 | // Swap memory (there are no memory.memsw.* entries) |
| 180 | func OptionalSwap() func(*memoryController) { |
| 181 | return func(mc *memoryController) { |
| 182 | _, err := os.Stat(filepath.Join(mc.root, "memory.memsw.usage_in_bytes")) |
| 183 | if os.IsNotExist(err) { |
| 184 | mc.ignored["memsw"] = struct{}{} |
| 185 | } |
| 186 | } |
| 187 | } |
| 188 | |
| 189 | type memoryController struct { |
| 190 | root string |
searching dependent graphs…