From mboxrd@z Thu Jan 1 00:00:00 1970 From: Li Zefan Subject: Re: [PATCH] Relax ns_can_attach checks to allow attaching to grandchild cgroups Date: Wed, 07 Jan 2009 09:58:43 +0800 Message-ID: <49640C53.7020403@cn.fujitsu.com> References: <20090106222536.GA25228@eskarina.localdomain.pl> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20090106222536.GA25228-IaEwMO9oKu/77SC2UrCW1JJg/dWx8T/9@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: Grzegorz Nosek Cc: containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.org, akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org List-Id: containers.vger.kernel.org Grzegorz Nosek wrote: > The ns_proxy cgroup allows moving processes to child cgroups only one > level deep at a time. This commit relaxes this restriction and makes it > possible to attach tasks directly to grandchild cgroups, e.g.: > > ($pid is in the root cgroup) > echo $pid > /cgroup/CG1/CG2/tasks > > Previously this operation would fail with -EPERM and would have to be > performed as two steps: > echo $pid > /cgroup/CG1/tasks > echo $pid > /cgroup/CG1/CG2/tasks > > Also, the target cgroup no longer needs to be empty to move a task there. > > Signed-off-by: Grzegorz Nosek Reviewed-by: Li Zefan > --- > include/linux/cgroup.h | 4 ++-- > kernel/cgroup.c | 11 ++++++----- > kernel/ns_cgroup.c | 14 ++++---------- > 3 files changed, 12 insertions(+), 17 deletions(-)