From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Serge E. Hallyn" Subject: Re: Can not remove the subdirectory in cgroup pseudo-filesystem Date: Wed, 25 Mar 2009 20:51:56 -0500 Message-ID: <20090326015155.GA31480@us.ibm.com> References: <20090325163702.GA17626@us.ibm.com> <49CAD714.4080307@cn.fujitsu.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <49CAD714.4080307-BthXqXjhjHXQFUHtdCDX3A@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: Li Zefan Cc: Linux Containers List-Id: containers.vger.kernel.org Quoting Li Zefan (lizf-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org): > anqin wrote: > >> Yes you have to initialize some cpuset files first. Otherwise > >> the tasks have no access to any memory or cpus. > >> > > > > Oh... thank you for reminding. Previously, I run my tests in > > a experimental kernel, it seems someone has set the > > parameters. > > > > > > BTW, is it possible currently to combine two tasks into > > one cgroup? for instance, I have run two bashes (bash_A and > > I recomend you to read Documentation/cgroups/cgroups.txt to know > cgroup better. Cgroup is used to aggregate/partition sets of tasks, > so of course you can put more than 1 task into a cgroup. > > > bash_B). Now, in bash_A, I created a cgroup in procfs: > > > > # mount -t cgroup cgroup /mnt/cgrp > > mount cgroupfs with all cgroup subsystems is not so sane IMO. > > > # cd /mnt/cgrp > > # mkdir test > > # echo $$ > test/tasks > > > > Then, I would like to add bash_B in this task group but > > fail: > > > > # echo #(PID_OF_bash_B) > test/tasks > > -bash: echo: write error: Operation not permitted > > > > That's because ns_cgroup is binded in this cgroup hierarchy, and > it's ns_cgroup that prevents the task attaching, but a patch in > -mm tree relaxes this check, and you won't see this restriction > when using ns_cgroup. Ooh, right, you can only enter an empty cgroup in "older" kernels... In my defense, that made sense when the ns cgroup was still possibly going to be used for allowing tasks to enter each other's namespaces. :) -serge > > It seems the cgroup can not couple two irrelevant > > task together, right? > > > > > > Best, > > > > Anqin