OpenVZ Forum


Home » Mailing lists » Devel » cgroup tasks file error
Re: cgroup tasks file error [message #41939 is a reply to message #41930] Tue, 14 December 2010 19:23 Go to previous messageGo to previous message
ccmail111 is currently offline  ccmail111
Messages: 10
Registered: December 2010
Junior Member
Hi Serge,

Thanks for the tip.
It seems to work (no ns).

[host:~]$ mount -t cgroup cpuset -ocpuset /dev/cgroup
[host:~]$ ls /dev/cgroup
cgroup.procs cpuset.memory_spread_page
cpuset.cpu_exclusive cpuset.memory_spread_slab
cpuset.cpus cpuset.mems
cpuset.mem_exclusive cpuset.sched_load_balance
cpuset.mem_hardwall cpuset.sched_relax_domain_level
cpuset.memory_migrate notify_on_release
cpuset.memory_pressure release_agent
cpuset.memory_pressure_enabled tasks

$ps aux | grep daemon
root 572 0.0 0.9 88816 2216 ? Sl 18:25 0:00 myproc --daemon

[host:~]$ mkdir /dev/cgroup/hello
[host:~]$ echo 0 > /dev/cgroup/hello/cpuset.mems
[host:~]$ echo 0 > /dev/cgroup/hello/cpuset.cpus
[host:~]$ echo 572 > /dev/cgroup/hello/tasks
[host:~]$ cat /dev/cgroup/hello/tasks
572

Now move it back..

[host:~]$ echo 572 > /dev/cgroup/tasks

check:
[host:~]$ cat /dev/cgroup/hello/tasks
[host:~]$
[host:~]$ cat /dev/cgroup/tasks | grep 572
572
[host:~]$ id
uid=0(root) gid=0(root) groups=0(root)
[host:~]$

Thanks everyone !




--- On Tue, 12/14/10, Serge Hallyn <serge.hallyn@canonical.com> wrote:

> From: Serge Hallyn <serge.hallyn@canonical.com>
> Subject: Re: cgroup tasks file error
> To: "ccmail111" <ccmail111@yahoo.com>
> Cc: "Jue Hong" <honshj@gmail.com>, "Matt Helsley" <matthltc@us.ibm.com>, containers@lists.linux-foundation.org
> Date: Tuesday, December 14, 2010, 12:40 PM
> Quoting ccmail111 (ccmail111@yahoo.com):
> >
> > Isn't ns mounted by default ?
>
> I thought that in an earlier email you said you had done
>
>     mount -t cgroup cpuset -ocpuset
> /dev/cgroup
>
> in which case ns would not be mounted.  But note, we
> DO NOT
> want you to have ns mounted :)
>
> > I rebooted machine,
> > based on 2.6.32 kernel.
> >
> > Then,
> >
> > [host:~]$ mkdir /dev/cgroup
> > [host:~]$ mount -t cgroup cpuset -ocpuset,ns
> /dev/cgroup
> > [host:~]$ ps aux | grep libvirt
> > root       575 
> 0.6  0.9  88816  2216 ?     
>   Sl   17:28   0:00
> myproc --daemon
> > root       654 
> 0.0  0.2   4044   664
> ttyS0   
> S+   17:29   0:00 grep
> libvirt
> > [host:~]$ mkdir /dev/cgroup/hello
> > [host:~]$ cat /dev/cgroup/hello/tasks
> > [host:~]$ echo 0 > /dev/cgroup/hello/cpuset.cpus
> > [host:~]$ echo 0 > /dev/cgroup/hello/cpuset.mems
> > [host:~]$ echo 575 > /dev/cgroup/hello/tasks
> > [host:~]$ cat /dev/cgroup/hello/tasks
> > 575
> > [host:~]$ id
> > uid=0(root) gid=0(root) groups=0(root)
> > [host:~]$
> >
> > Now, I try to move the task out - the parent/root:
> >
> > [host:~]$ echo 575 > /dev/cgroup/tasks
> > -bash: echo: write error: Operation not permitted
> >
> >
> > Any thoughts !?
>
> Yes, ns cgroup is forbidding you from moving back :) 
> Mount without it.
>
> -serge
>



_______________________________________________
Containers mailing list
Containers@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containe rs
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: [PATCH cgroups] Remove deprecated subsystem from examples.
Next Topic: Mapping PIDs from parent-&gt;child namespaces
Goto Forum:
  


Current Time: Thu Oct 09 17:01:25 GMT 2025

Total time taken to generate the page: 0.07921 seconds