Skip to content

Commit 834fb5d

Browse files
committed
spec: linux: add support for the PIDs cgroup
Add support for the PIDs cgroup as a cgroup resource constraint in the Linux container specification. Since PIDs are a real resource, we need to support the ability to limit them. The PIDs cgroup subsystem is available in Linux 4.3+. Signed-off-by: Aleksa Sarai <[email protected]>
1 parent 138deee commit 834fb5d

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

runtime-config-linux.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ Next parameters can be specified:
128128
## Control groups
129129

130130
Also known as cgroups, they are used to restrict resource usage for a container and handle
131-
device access. cgroups provide controls to restrict cpu, memory, IO, and network for
131+
device access. cgroups provide controls to restrict cpu, memory, IO, pids and network for
132132
the container. For more information, see the [kernel cgroups documentation](https://www.kernel.org/doc/Documentation/cgroups/cgroups.txt).
133133

134134
## Sysctl

runtime_config_linux.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,11 @@ type CPU struct {
126126
Mems string `json:"mems"`
127127
}
128128

129+
type Pids struct {
130+
// Maximum number of PIDs. A value < 0 implies "no limit".
131+
Limit int64 `json:"limit"`
132+
}
133+
129134
// Network identification and priority configuration
130135
type Network struct {
131136
// Set class identifier for container's network packets
@@ -142,6 +147,8 @@ type Resources struct {
142147
Memory Memory `json:"memory"`
143148
// CPU resource restriction configuration
144149
CPU CPU `json:"cpu"`
150+
// Task resource restriction configuration.
151+
Pids Pids `json:"pids"`
145152
// BlockIO restriction configuration
146153
BlockIO BlockIO `json:"blockIO"`
147154
// Hugetlb limit (in bytes)

0 commit comments

Comments
 (0)