]> git.proxmox.com Git - mirror_lxc.git/commit - src/lxc/start.c
cgmanager: don't stay connected
authorSerge Hallyn <serge.hallyn@ubuntu.com>
Fri, 28 Feb 2014 23:50:22 +0000 (17:50 -0600)
committerStéphane Graber <stgraber@ubuntu.com>
Mon, 3 Mar 2014 15:59:42 +0000 (10:59 -0500)
commit73d28d4295aea27abc38a309ba94b2046675abc1
tree2448586004cd9ef6d3fcf920707a9e466f9bac01
parentc18d419f7c725f9073454f996a3fb51365cf925a
cgmanager: don't stay connected

There are only a few times when we need to be connected to the
cgroup manager:

* when starting a container, from cgm_init until we've set cgroup limits
* when changing a cgroup setting (while running)
* when cleaning up (when shutting down)
* around the cgroup entering at attach

So only connect/disconnect the cgmanager socket on-demand as
needed.  This should have a few benefits.

1. Reduce the # open fds when many containers are running
2. if cgmanager is stopped and restarted, the container
   doesn't have to deal with the disconnection.

This is currently RFC.  There are a few issues outstanding:

1. the cgm_set and cgm_get may need to be made thread-safe.
2. a non-daemonized start which fails while cgm is connected,
will not disconnected.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
src/lxc/cgmanager.c
src/lxc/cgroup.c
src/lxc/cgroup.h
src/lxc/start.c