[lxc-devel] [PATCH] cgmanager: attach: never use 'all' controller
Stéphane Graber
stgraber at ubuntu.com
Tue Jun 2 23:02:46 UTC 2015
On Wed, May 27, 2015 at 10:05:16AM +0000, Serge Hallyn wrote:
> We were using 'all' controller if current was in all the
> same cgroup. That doesn't suffice. We'd have to check
> the target. At that point we may as well just attach
> controller by controller.
>
> An optimization to consider is to check the /proc/initpid/cgroup
> for all identical controllers. Let's start by just getting it
> right.
>
> Signed-off-by: Serge Hallyn <serge.hallyn at ubuntu.com>
Acked-by: Stéphane Graber <stgraber at ubuntu.com>
> ---
> src/lxc/cgmanager.c | 10 +---------
> 1 file changed, 1 insertion(+), 9 deletions(-)
>
> diff --git a/src/lxc/cgmanager.c b/src/lxc/cgmanager.c
> index 7dddb89..859143c 100644
> --- a/src/lxc/cgmanager.c
> +++ b/src/lxc/cgmanager.c
> @@ -1311,16 +1311,8 @@ static bool cgm_attach(const char *name, const char *lxcpath, pid_t pid)
> return false;
> }
>
> - check_supports_multiple_controllers(pid);
> -
> - if (cgm_all_controllers_same)
> - slist = subsystems_inone;
> -
> for (i = 0; slist[i]; i++) {
> - if (slist == subsystems_inone)
> - cgroup = try_get_abs_cgroup(name, lxcpath, subsystems[0]);
> - else
> - cgroup = try_get_abs_cgroup(name, lxcpath, slist[i]);
> + cgroup = try_get_abs_cgroup(name, lxcpath, slist[i]);
> if (!cgroup) {
> ERROR("Failed to get cgroup for controller %s", slist[i]);
> cgm_dbus_disconnect();
> --
> 2.1.4
>
> _______________________________________________
> lxc-devel mailing list
> lxc-devel at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-devel
--
Stéphane Graber
Ubuntu developer
http://www.ubuntu.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20150602/4831a711/attachment.sig>
More information about the lxc-devel
mailing list