]> git.ipfire.org Git - thirdparty/lxc.git/commit
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>
Thu, 5 Dec 2019 10:00:09 +0000 (11:00 +0100)
commitec26ee91c3ba0e234bed64a543b84366a4471b8a
treeb287a320dea893013a6e8ea77932a7b07afc13e7
parent1e8adfa12f774243c5a58c7d74d2948125859491
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