aboutsummaryrefslogtreecommitdiff
path: root/libpod/container_internal_linux.go
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@gmail.com>2018-07-05 14:10:13 -0400
committerAtomic Bot <atomic-devel@projectatomic.io>2018-07-06 15:29:38 +0000
commiteae800789631baa7d377568b2019abd8359cbf70 (patch)
tree871496913e9d248a4b57bea39c42a154013de416 /libpod/container_internal_linux.go
parent99959e55fa8e902302a580b13d53bc52d0074ad7 (diff)
downloadpodman-eae800789631baa7d377568b2019abd8359cbf70.tar.gz
podman-eae800789631baa7d377568b2019abd8359cbf70.tar.bz2
podman-eae800789631baa7d377568b2019abd8359cbf70.zip
Remove per-container CGroup parents
Originally, it seemed like a good idea to place Conmon and the container it managed under a shared CGroup, so we could manage the two together. It's become increasingly clear that this is a potential performance sore point, gains us little practical benefit in managing Conmon, and adds extra steps to container cleanup that interfere with Conmon postrun hooks. Revert back to a shared CGroup for conmon processes under the CGroup parent. This will retain per-pod conmon CGroups as well if the pod is set to create a CGroup and act as CGroup parent for its containers. Signed-off-by: Matthew Heon <matthew.heon@gmail.com> Closes: #1051 Approved by: umohnani8
Diffstat (limited to 'libpod/container_internal_linux.go')
-rw-r--r--libpod/container_internal_linux.go43
1 files changed, 0 insertions, 43 deletions
diff --git a/libpod/container_internal_linux.go b/libpod/container_internal_linux.go
index 327c78045..0dc02d117 100644
--- a/libpod/container_internal_linux.go
+++ b/libpod/container_internal_linux.go
@@ -6,12 +6,10 @@ import (
"context"
"fmt"
"path"
- "path/filepath"
"strings"
"syscall"
"time"
- "github.com/containerd/cgroups"
"github.com/containers/storage/pkg/idtools"
spec "github.com/opencontainers/runtime-spec/specs-go"
"github.com/opencontainers/runtime-tools/generate"
@@ -24,47 +22,6 @@ import (
"golang.org/x/sys/unix"
)
-// cleanupCgroup cleans up residual CGroups after container execution
-// This is a no-op for the systemd cgroup driver
-func (c *Container) cleanupCgroups() error {
- if !c.state.CgroupCreated {
- logrus.Debugf("Cgroups are not present, ignoring...")
- return nil
- }
-
- if c.runtime.config.CgroupManager == SystemdCgroupsManager {
- return nil
- }
-
- // Remove the base path of the container's cgroups
- path := filepath.Join(c.config.CgroupParent, fmt.Sprintf("libpod-%s", c.ID()))
-
- logrus.Debugf("Removing CGroup %s", path)
-
- cgroup, err := cgroups.Load(cgroups.V1, cgroups.StaticPath(path))
- if err != nil {
- // It's fine for the cgroup to not exist
- // We want it gone, it's gone
- if err == cgroups.ErrCgroupDeleted {
- return nil
- }
-
- return err
- }
-
- if err := cgroup.Delete(); err != nil {
- return err
- }
-
- c.state.CgroupCreated = false
-
- if c.valid {
- return c.save()
- }
-
- return nil
-}
-
func (c *Container) mountSHM(shmOptions string) error {
if err := unix.Mount("shm", c.config.ShmDir, "tmpfs", unix.MS_NOEXEC|unix.MS_NOSUID|unix.MS_NODEV,
label.FormatMountLabel(shmOptions, c.config.MountLabel)); err != nil {