Skip to content

Commit 8b180f3

Browse files
authored
Merge pull request #985 from masters-of-cats/master
config-linux: Add Memory cgroup's use_hierarchy
2 parents cd13d2d + 234aa0b commit 8b180f3

File tree

4 files changed

+9
-1
lines changed

4 files changed

+9
-1
lines changed

config-linux.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,8 @@ The following properties do not specify memory limits, but are covered by the `m
275275
If enabled (`false`), tasks that attempt to consume more memory than they are allowed are immediately killed by the OOM killer.
276276
The OOM killer is enabled by default in every cgroup using the `memory` subsystem.
277277
To disable it, specify a value of `true`.
278+
* **`useHierarchy`** *(bool, OPTIONAL)* - enables or disables hierarchical memory accounting.
279+
If enabled (`true`), child cgroups will share the memory limits of this cgroup.
278280

279281
#### Example
280282

schema/config-linux.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,9 @@
160160
},
161161
"disableOOMKiller": {
162162
"type": "boolean"
163+
},
164+
"useHierarchy": {
165+
"type": "boolean"
163166
}
164167
}
165168
},

schema/test/config/good/spec-example.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,8 @@
246246
"kernel": -1,
247247
"kernelTCP": -1,
248248
"swappiness": 0,
249-
"disableOOMKiller": false
249+
"disableOOMKiller": false,
250+
"useHierarchy": false
250251
},
251252
"cpu": {
252253
"shares": 1024,

specs-go/config.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,8 @@ type LinuxMemory struct {
293293
Swappiness *uint64 `json:"swappiness,omitempty"`
294294
// DisableOOMKiller disables the OOM killer for out of memory conditions
295295
DisableOOMKiller *bool `json:"disableOOMKiller,omitempty"`
296+
// Enables hierarchical memory accounting
297+
UseHierarchy *bool `json:"useHierarchy,omitempty"`
296298
}
297299

298300
// LinuxCPU for Linux cgroup 'cpu' resource management

0 commit comments

Comments
 (0)