]> git.proxmox.com Git - mirror_lxc.git/commit - src/lxc/cgroups/cgfsng.c
cgroups: improve container cgroup attaching
authorChristian Brauner <christian.brauner@ubuntu.com>
Wed, 4 Dec 2019 12:26:54 +0000 (13:26 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Wed, 4 Dec 2019 12:53:56 +0000 (13:53 +0100)
commit900b6606584e484b7528043b851320f9b110706b
tree946a55e20b1b15a36ae71c793294dee6423138a8
parent23a917e5d242698607edc4cf5dd270bb744e843d
cgroups: improve container cgroup attaching

The current attach.c codepath which handles moving the attaching process into
the container's cgroups allocates a whole new struct cgroup_ops and goes
through the trouble of reparsing the whole cgroup layout.
That's costly and wasteful. My plan has always been to move this into the
command api by getting fds for attaching back but but it's not worth going
through that hazzle for non-unified hosts. On pure unified hosts however -
being the future - we can just attach through a single fd so there's no need to
allocate and setup struct cgroup_ops.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/attach.c
src/lxc/cgroups/cgfsng.c
src/lxc/cgroups/cgroup.h
src/lxc/commands.c
src/lxc/log.h
src/lxc/macro.h