MCPcopy Create free account
hub / github.com/containerd/cgroups / Update

Method Update

cgroup1/cgroup.go:353–371  ·  view source on GitHub ↗

Update updates the cgroup with the new resource values provided Be prepared to handle EBUSY when trying to update a cgroup with live processes and other operations like Stats being performed at the same time

(resources *specs.LinuxResources)

Source from the content-addressed store, hash-verified

351// live processes and other operations like Stats being performed at the
352// same time
353func (c *cgroup) Update(resources *specs.LinuxResources) error {
354 c.mu.Lock()
355 defer c.mu.Unlock()
356 if c.err != nil {
357 return c.err
358 }
359 for _, s := range c.subsystems {
360 if u, ok := s.(updater); ok {
361 sp, err := c.path(s.Name())
362 if err != nil {
363 return err
364 }
365 if err := u.Update(sp, resources); err != nil {
366 return err
367 }
368 }
369 }
370 return nil
371}
372
373// Processes returns the processes running inside the cgroup along
374// with the subsystem used, pid, and path

Callers

nothing calls this directly

Calls 2

NameMethod · 0.65
UpdateMethod · 0.65

Tested by

no test coverage detected