Skip to content

Commit 01a367e

Browse files
committed
Cg2: Add ability to set memory.oom.group
Following the last patch, this allows setting the oom.group value in general. Signed-off-by: Danny Canter <danny@dcantah.dev>
1 parent 326585f commit 01a367e

1 file changed

Lines changed: 16 additions & 5 deletions

File tree

cgroup2/memory.go

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@
1717
package cgroup2
1818

1919
type Memory struct {
20-
Swap *int64
21-
Min *int64
22-
Max *int64
23-
Low *int64
24-
High *int64
20+
Swap *int64
21+
Min *int64
22+
Max *int64
23+
Low *int64
24+
High *int64
25+
OOMGroup *bool
2526
}
2627

2728
func (r *Memory) Values() (o []Value) {
@@ -55,5 +56,15 @@ func (r *Memory) Values() (o []Value) {
5556
value: *r.High,
5657
})
5758
}
59+
if r.OOMGroup != nil {
60+
var val int64
61+
if *r.OOMGroup {
62+
val = 1
63+
}
64+
o = append(o, Value{
65+
filename: "memory.oom.group",
66+
value: val,
67+
})
68+
}
5869
return o
5970
}

0 commit comments

Comments
 (0)