Skip to content

Commit 234aa0b

Browse files
config-linux: Add Memory cgroup's use_hierarchy
Co-authored-by: Claudia Beresford <[email protected]> Signed-off-by: Danail Branekov <[email protected]>
1 parent d810dbc commit 234aa0b

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
@@ -159,6 +159,9 @@
159159
},
160160
"disableOOMKiller": {
161161
"type": "boolean"
162+
},
163+
"useHierarchy": {
164+
"type": "boolean"
162165
}
163166
}
164167
},

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,8 @@
242242
"kernel": -1,
243243
"kernelTCP": -1,
244244
"swappiness": 0,
245-
"disableOOMKiller": false
245+
"disableOOMKiller": false,
246+
"useHierarchy": false
246247
},
247248
"cpu": {
248249
"shares": 1024,

specs-go/config.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,8 @@ type LinuxMemory struct {
288288
Swappiness *uint64 `json:"swappiness,omitempty"`
289289
// DisableOOMKiller disables the OOM killer for out of memory conditions
290290
DisableOOMKiller *bool `json:"disableOOMKiller,omitempty"`
291+
// Enables hierarchical memory accounting
292+
UseHierarchy *bool `json:"useHierarchy,omitempty"`
291293
}
292294

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

0 commit comments

Comments
 (0)