Skip to content

Commit

Permalink
config-linux: Add Memory cgroup's use_hierarchy
Browse files Browse the repository at this point in the history
Signed-off-by: Tom Godkin <[email protected]>
Co-authored-by: Claudia Beresford <[email protected]>
  • Loading branch information
Tom Godkin and Callisto13 committed Aug 21, 2018
1 parent d810dbc commit 726b4f8
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions config-linux.md
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,8 @@ The following properties do not specify memory limits, but are covered by the `m
If enabled (`false`), tasks that attempt to consume more memory than they are allowed are immediately killed by the OOM killer.
The OOM killer is enabled by default in every cgroup using the `memory` subsystem.
To disable it, specify a value of `true`.
* **`useHierarchy`** *(bool, OPTIONAL)* - enables or disables hierarchical memory accounting.
If enabled (`true`), child cgroups will share the memory limits of this cgroup.

#### Example

Expand Down
3 changes: 3 additions & 0 deletions schema/config-linux.json
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,9 @@
},
"disableOOMKiller": {
"type": "boolean"
},
"useHierarchy": {
"type": "boolean"
}
}
},
Expand Down
3 changes: 2 additions & 1 deletion schema/test/config/good/spec-example.json
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,8 @@
"kernel": -1,
"kernelTCP": -1,
"swappiness": 0,
"disableOOMKiller": false
"disableOOMKiller": false,
"useHierarchy": false
},
"cpu": {
"shares": 1024,
Expand Down
2 changes: 2 additions & 0 deletions specs-go/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,8 @@ type LinuxMemory struct {
Swappiness *uint64 `json:"swappiness,omitempty"`
// DisableOOMKiller disables the OOM killer for out of memory conditions
DisableOOMKiller *bool `json:"disableOOMKiller,omitempty"`
// Enables hierarchical memory accounting
UseHierarchy *bool `json:"useHierarchy,omitempty"`
}

// LinuxCPU for Linux cgroup 'cpu' resource management
Expand Down

0 comments on commit 726b4f8

Please sign in to comment.