summaryrefslogtreecommitdiffhomepage
path: root/runsc/cgroup
diff options
context:
space:
mode:
authorFabricio Voznika <fvoznika@google.com>2018-12-28 13:47:19 -0800
committerShentubot <shentubot@google.com>2018-12-28 13:48:24 -0800
commita891afad6d7e3b09bafdccb4cc4b9fc4e577620e (patch)
tree5dc0a3be78d6e06f24ddc22b9a4df7de094d09bf /runsc/cgroup
parent652d068119052b0b3bc4a0808a4400a22380a30b (diff)
Simplify synchronization between runsc and sandbox process
Make 'runsc create' join cgroup before creating sandbox process. This removes the need to synchronize platform creation and ensure that sandbox process is charged to the right cgroup from the start. PiperOrigin-RevId: 227166451 Change-Id: Ieb4b18e6ca0daf7b331dc897699ca419bc5ee3a2
Diffstat (limited to 'runsc/cgroup')
-rw-r--r--runsc/cgroup/cgroup.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/runsc/cgroup/cgroup.go b/runsc/cgroup/cgroup.go
index 15071387b..2887f3d7f 100644
--- a/runsc/cgroup/cgroup.go
+++ b/runsc/cgroup/cgroup.go
@@ -241,6 +241,11 @@ func (c *Cgroup) Uninstall() error {
return nil
}
+// Join adds the current process to the all controllers.
+func (c *Cgroup) Join() error {
+ return c.Add(0)
+}
+
// Add adds given process to all controllers.
func (c *Cgroup) Add(pid int) error {
for key := range controllers {