[Devel] Re: container userspace tools

Balbir Singh balbir at linux.vnet.ibm.com
Fri Dec 12 06:25:29 PST 2008


* Ian jonhson <jonhson.ian at gmail.com> [2008-12-12 18:02:22]:

> >
> > OK, so this is not an lxc kernel, but a mainline kernel.
> >
> 
> So, what is the lxc kernel you meat? Is it different from the
> 2.6.27-rc8. I use that version  recommended by Daniel.
> 
> >>
> >> > 1. Can you see the memory.usage_in_bytes corresponding to the control
> >> > group where you run the container
> >>
> >> How can I know the number correspond to the control group?
> >
> > From outside the container, figure out the process id of init and then
> > do a cat /proc/<pid>/cgroup. Then go to that directory and cat
> > memory.usage_in_bytes, memory.stat and memory.limit_in_bytes to verify
> > the setup
> >
> 
> OK, I have done the checking, but I don't understand what is meaning of
> "corresponding". The content is shown as follows:
> 
> $ cat /proc/4506/cgroup
> 255:freezer,devices,memory,cpuacct,cpu,ns,debug,cpuset:/
> $ cat memory.usage_in_bytes
> 223932416

OK, so memory.usage_in_bytes is 223932416 for the root cgroup. You
process 4506, which is (I assume) a container process is running in
"/" or the root cgroup. By default root cgroups are unlimited. You can
verify by reading memory.limit_in_bytes

> 
> 
> >>
> >> > 2. Check tasks file to see that the container tasks are indeed in the
> >> > container.
> >> >
> >>
> >> My program forks a child and its child (grandson of previous process) call the
> >> the /bin/bash to open a shell. I just can find the parent process is
> >> in container
> >> tasks file, but its child and grandson process are not.
> >>
> >
> > Hmmm.. but the child and grandson are alive right?
> yes... I can see them by a container-outside bash running with ps
> 
> > Do a cat
> > /proc/<pid>/cgroup on them to see where they went or where they are.
> >
> 
> They are all there, similar with pid=4506.
> 
> $ cat /proc/4506/cgroup
> 255:freezer,devices,memory,cpuacct,cpu,ns,debug,cpuset:/
> $ cat /proc/4507/cgroup
> 255:freezer,devices,memory,cpuacct,cpu,ns,debug,cpuset:/4507
> $ cat /proc/4508/cgroup
> 255:freezer,devices,memory,cpuacct,cpu,ns,debug,cpuset:/4506
>

Are there three containers on the system

Can you send me the output of <cgroup mount point>/4507/memory.* and
4506/memory.*. cgroup mount point can be obtained from /proc/mounts.
 

-- 
	Balbir
_______________________________________________
Containers mailing list
Containers at lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers




More information about the Devel mailing list