OpenVZ Forum


Home » Mailing lists » Devel » cgroup tasks file error
cgroup tasks file error [message #41930] Mon, 13 December 2010 22:25 Go to next message
ccmail111 is currently offline  ccmail111
Messages: 10
Registered: December 2010
Junior Member
I see error:[host:/dev/cgroup]$ echo 693 > hello-test/tasks
-bash: echo: write error: No space left on device
[host:/dev/cgroup]$ pwd/dev/cgroup

But the user process is up and running..

[host:/dev/cgroup]$ ps aux | grep procroot      

693  0.0  0.4  34720  1112 ttyS0    Sl   19:11   0:00 /opt/bin/myproc -ext

Also the cgroup exists and valid..

[host:/dev/cgroup]$ ls | grep hello-test
hello-test

What above error mean and any suggestions ?
Please email.

Thanks,
CM







_______________________________________________
Containers mailing list
Containers@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containe rs
Re: cgroup tasks file error [message #41931 is a reply to message #41930] Tue, 14 December 2010 01:23 Go to previous messageGo to next message
ccmail111 is currently offline  ccmail111
Messages: 10
Registered: December 2010
Junior Member
Hi Serge,

Thanks for quick response.

I had mounted as:

mount -t cgroup cpuset /dev/cgroup

After setting below, it works.
Thank you for helpful tip !


--- On Mon, 12/13/10, Serge E. Hallyn <serge.hallyn@canonical.com> wrote:

> From: Serge E. Hallyn <serge.hallyn@canonical.com>
> Subject: Re: cgroup tasks file error
> To: "ccmail111" <ccmail111@yahoo.com>
> Cc: containers@lists.linux-foundation.org
> Date: Monday, December 13, 2010, 6:16 PM
> Quoting ccmail111 (ccmail111@yahoo.com):
> >
> > I see error:[host:/dev/cgroup]$ echo 693 >
> hello-test/tasks
> > -bash: echo: write error: No space left on device
> > [host:/dev/cgroup]$ pwd/dev/cgroup
> >
> > But the user process is up and running..
> >
> > [host:/dev/cgroup]$ ps aux | grep procroot      
> >
> > 693  0.0  0.4  34720  1112 ttyS0    Sl   19:11
>   0:00 /opt/bin/myproc -ext
> >
> > Also the cgroup exists and valid..
> >
> > [host:/dev/cgroup]$ ls | grep hello-test
> > hello-test
> >
> > What above error mean and any suggestions ?
> > Please email.
>
> Which cgroups do you have composed on that mount?  I'm
> guess you
> have cpuset, and you need to set the cpuset.mems and
> cpuset.cpus.
> Until you do that, no tasks can be assigned to it.
>
> -serge
>



_______________________________________________
Containers mailing list
Containers@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containe rs
Re: cgroup tasks file error [message #41932 is a reply to message #41930] Tue, 14 December 2010 01:27 Go to previous messageGo to next message
ccmail111 is currently offline  ccmail111
Messages: 10
Registered: December 2010
Junior Member
Hi Serge,

Now I cannot move the pid out of the assigned group !

[host:/dev/cgroup]$ cat cpuset.cpus
0
[host:/dev/cgroup]$ cat cpuset.mems
0
[host:/dev/cgroup]$ cat hello/tasks
580

[host:/dev/cgroup]$ echo 580 > tasks
-bash: echo: write error: Operation not permitted

[host:/dev/cgroup]$
[host:/dev/cgroup]$ cd hello
[host:/dev/cgroup/hello]$ cat cpuset.cpus
0
[host:/dev/cgroup/hello]$ cat cpuset.mems
0
[host:/dev/cgroup/hello]



--- On Mon, 12/13/10, ccmail111 <ccmail111@yahoo.com> wrote:

> From: ccmail111 <ccmail111@yahoo.com>
> Subject: Re: cgroup tasks file error
> To: "Serge E. Hallyn" <serge.hallyn@canonical.com>
> Cc: containers@lists.linux-foundation.org
> Date: Monday, December 13, 2010, 8:23 PM
> Hi Serge,
>
> Thanks for quick response.
>
> I had mounted as:
>
> mount -t cgroup cpuset /dev/cgroup
>
> After setting below, it works.
> Thank you for helpful tip !
>
>
> --- On Mon, 12/13/10, Serge E. Hallyn <serge.hallyn@canonical.com>
> wrote:
>
> > From: Serge E. Hallyn <serge.hallyn@canonical.com>
> > Subject: Re: cgroup tasks file error
> > To: "ccmail111" <ccmail111@yahoo.com>
> > Cc: containers@lists.linux-foundation.org
> > Date: Monday, December 13, 2010, 6:16 PM
> > Quoting ccmail111 (ccmail111@yahoo.com):
> > >
> > > I see error:[host:/dev/cgroup]$ echo 693 >
> > hello-test/tasks
> > > -bash: echo: write error: No space left on
> device
> > > [host:/dev/cgroup]$ pwd/dev/cgroup
> > >
> > > But the user process is up and running..
> > >
> > > [host:/dev/cgroup]$ ps aux | grep procroot    
>  
> > >
> > > 693  0.0  0.4  34720  1112 ttyS0    Sl  
> 19:11
> >   0:00 /opt/bin/myproc -ext
> > >
> > > Also the cgroup exists and valid..
> > >
> > > [host:/dev/cgroup]$ ls | grep hello-test
> > > hello-test
> > >
> > > What above error mean and any suggestions ?
> > > Please email.
> >
> > Which cgroups do you have composed on that mount? 
> I'm
> > guess you
> > have cpuset, and you need to set the cpuset.mems and
> > cpuset.cpus.
> > Until you do that, no tasks can be assigned to it.
> >
> > -serge
> >
>
>
>
>



_______________________________________________
Containers mailing list
Containers@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containe rs
Re: cgroup tasks file error [message #41933 is a reply to message #41930] Tue, 14 December 2010 02:50 Go to previous messageGo to next message
ccmail111 is currently offline  ccmail111
Messages: 10
Registered: December 2010
Junior Member
Hi Li,

uid is already root:

[host:/dev/cgroup]$ id
uid=0(root) gid=0(root) groups=0(root)


[host:/dev/cgroup]$ echo 580 > tasks
-bash: echo: write error: Operation not permitted

[host:/dev/cgroup]$ cat hello/tasks
580
610
2104
[host:/dev/cgroup]$




--- On Mon, 12/13/10, Li Zefan <lizf@cn.fujitsu.com> wrote:

> From: Li Zefan <lizf@cn.fujitsu.com>
> Subject: Re: cgroup tasks file error
> To: "ccmail111" <ccmail111@yahoo.com>
> Cc: "Serge E. Hallyn" <serge.hallyn@canonical.com>, containers@lists.linux-foundation.org
> Date: Monday, December 13, 2010, 8:34 PM
> ccmail111 wrote:
> > Hi Serge,
> >
> > Now I cannot move the pid out of the assigned group !
> >
>
> Try:
>
>   $ sudo echo 580 > tasks
>
> > [host:/dev/cgroup]$ cat cpuset.cpus
> > 0
> > [host:/dev/cgroup]$ cat cpuset.mems
> > 0
> > [host:/dev/cgroup]$ cat hello/tasks
> > 580
> >
> > [host:/dev/cgroup]$ echo 580 > tasks
> > -bash: echo: write error: Operation not permitted
> >
> > [host:/dev/cgroup]$
> > [host:/dev/cgroup]$ cd hello
> > [host:/dev/cgroup/hello]$ cat cpuset.cpus
> > 0
> > [host:/dev/cgroup/hello]$ cat cpuset.mems
> > 0
> > [host:/dev/cgroup/hello]
> >
> >
> >
> > --- On Mon, 12/13/10, ccmail111 <ccmail111@yahoo.com>
> wrote:
> >
> >> From: ccmail111 <ccmail111@yahoo.com>
> >> Subject: Re: cgroup tasks file error
> >> To: "Serge E. Hallyn" <serge.hallyn@canonical.com>
> >> Cc: containers@lists.linux-foundation.org
> >> Date: Monday, December 13, 2010, 8:23 PM
> >> Hi Serge,
> >>
> >> Thanks for quick response.
> >>
> >> I had mounted as:
> >>
> >>  mount -t cgroup cpuset /dev/cgroup
> >>
> >> After setting below, it works.
> >> Thank you for helpful tip !
> >>
> >>
> >> --- On Mon, 12/13/10, Serge E. Hallyn <serge.hallyn@canonical.com>
> >> wrote:
> >>
> >>> From: Serge E. Hallyn <serge.hallyn@canonical.com>
> >>> Subject: Re: cgroup tasks file error
> >>> To: "ccmail111" <ccmail111@yahoo.com>
> >>> Cc: containers@lists.linux-foundation.org
> >>> Date: Monday, December 13, 2010, 6:16 PM
> >>> Quoting ccmail111 (ccmail111@yahoo.com):
> >>>> I see error:[host:/dev/cgroup]$ echo 693
> >
> >>> hello-test/tasks
> >>>> -bash: echo: write error: No space left
> on
> >> device
> >>>> [host:/dev/cgroup]$ pwd/dev/cgroup
> >>>>
> >>>> But the user process is up and running..
> >>>>
> >>>> [host:/dev/cgroup]$ ps aux | grep
> procroot   
> >>   
> >>>> 693  0.0  0.4  34720 
> 1112 ttyS0    Sl 
> >> 19:11
> >>>   0:00 /opt/bin/myproc -ext
> >>>> Also the cgroup exists and valid..
> >>>>
> >>>> [host:/dev/cgroup]$ ls | grep hello-test
> >>>> hello-test
> >>>>
> >>>> What above error mean and any suggestions
> ?
> >>>> Please email.
> >>> Which cgroups do you have composed on that
> mount?
> >> I'm
> >>> guess you
> >>> have cpuset, and you need to set the
> cpuset.mems and
> >>> cpuset.cpus.
> >>> Until you do that, no tasks can be assigned to
> it.
> >>>
> >>> -serge
> >>>
> >>
> >>
> >>
> >
>



_______________________________________________
Containers mailing list
Containers@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containe rs
Re: cgroup tasks file error [message #41934 is a reply to message #41930] Tue, 14 December 2010 07:28 Go to previous messageGo to next message
ccmail111 is currently offline  ccmail111
Messages: 10
Registered: December 2010
Junior Member
Thanks Matt.
After doing what Serge suggests, I was able to create a dummy cgroup and
move task (#580) below to the group. But now..
I see another issue: cannot move the task back to its parent (root), from the group (hello) as in:

I am trying to move back task #580..

[host:/dev/cgroup]$ id
uid=0(root) gid=0(root) groups=0(root)


[host:/dev/cgroup]$ echo 580 > tasks
-bash: echo: write error: Operation not permitted

[host:/dev/cgroup]$ cat hello/tasks
580
610
2104
[host:/dev/cgroup]$


--- On Mon, 12/13/10, Matt Helsley <matthltc@us.ibm.com> wrote:

> From: Matt Helsley <matthltc@us.ibm.com>
> Subject: Re: cgroup tasks file error
> To: "Serge E. Hallyn" <serge.hallyn@canonical.com>
> Cc: "ccmail111" <ccmail111@yahoo.com>, containers@lists.linux-foundation.org
> Date: Monday, December 13, 2010, 8:02 PM
> On Mon, Dec 13, 2010 at 05:16:28PM
> -0600, Serge E. Hallyn wrote:
> > Quoting ccmail111 (ccmail111@yahoo.com):
> > >
> > > I see error:[host:/dev/cgroup]$ echo 693 >
> hello-test/tasks
> > > -bash: echo: write error: No space left on
> device
>
> This does seem quite odd so I spent a little time looking
> at this and I agree with Serge.
>
> > > [host:/dev/cgroup]$ pwd/dev/cgroup
> > >
> > > But the user process is up and running..
> > >
> > > [host:/dev/cgroup]$ ps aux | grep procroot    
>  
> > >
> > > 693  0.0  0.4  34720  1112 ttyS0    Sl  
> 19:11   0:00 /opt/bin/myproc -ext
> > >
> > > Also the cgroup exists and valid..
> > >
> > > [host:/dev/cgroup]$ ls | grep hello-test
> > > hello-test
> > >
> > > What above error mean and any suggestions ?
> > > Please email.
> >
> > Which cgroups do you have composed on that
> mount?  I'm guess you
> > have cpuset, and you need to set the cpuset.mems and
> cpuset.cpus.
> > Until you do that, no tasks can be assigned to it.
>
> I looked a a few places in kernel/cgroup.c which return
> ENOSPC
> or could potentially forward such an error. The only place
> that
> fits is in the attach path and is consistent with the
> notion that
> it's a cpuset issue:
>
> echo <pid> > tasks =>
> cgroup_tasks_write() =>
> attach_task_by_pid() =>
> cgroup_attach_task() => (via ss->can_attach() where
> ss is the cpuset subsystem)
> cpuset_can_attach():
>         if
> (cpumask_empty(cs->cpus_allowed) ||
> nodes_empty(cs->mems_allowed))
>            
> return -ENOSPC;
>
> No other cgroup subsystem that I looked at (freezer,
> memcontrol, ns,
>     blkio, devcgroup) returns ENOSPC when
> attaching a task.
>
> So not only do you need to set those masks but each mask
> must have at
> least one cpu and "mem" respectively.
>
> Cheers,
>     -Matt Helsley
>



_______________________________________________
Containers mailing list
Containers@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containe rs
Re: cgroup tasks file error [message #41935 is a reply to message #41934] Tue, 14 December 2010 09:39 Go to previous messageGo to next message
Jue Hong is currently offline  Jue Hong
Messages: 1
Registered: December 2010
Junior Member
Have you mounted the ns subsys?
The ns subsys will place some restrictions on the task movement.

On Tue, Dec 14, 2010 at 3:28 PM, ccmail111 <ccmail111@yahoo.com> wrote:
>
> Thanks Matt.
> After doing what Serge suggests, I was able to create a dummy cgroup and
> move task (#580) below to the group. But now..
> I see another issue: cannot move the task back to its parent (root), from the group (hello) as in:
>
> I am trying to move back task #580..
>
> [host:/dev/cgroup]$ id
> uid=0(root) gid=0(root) groups=0(root)
>
>
> [host:/dev/cgroup]$ echo 580 > tasks
> -bash: echo: write error: Operation not permitted
>
> [host:/dev/cgroup]$ cat hello/tasks
> 580
> 610
> 2104
> [host:/dev/cgroup]$
>
>
> --- On Mon, 12/13/10, Matt Helsley <matthltc@us.ibm.com> wrote:
>
>> From: Matt Helsley <matthltc@us.ibm.com>
>> Subject: Re: cgroup tasks file error
>> To: "Serge E. Hallyn" <serge.hallyn@canonical.com>
>> Cc: "ccmail111" <ccmail111@yahoo.com>, containers@lists.linux-foundation.org
>> Date: Monday, December 13, 2010, 8:02 PM
>> On Mon, Dec 13, 2010 at 05:16:28PM
>> -0600, Serge E. Hallyn wrote:
>> > Quoting ccmail111 (ccmail111@yahoo.com):
>> > >
>> > > I see error:[host:/dev/cgroup]$ echo 693 >
>> hello-test/tasks
>> > > -bash: echo: write error: No space left on
>> device
>>
>> This does seem quite odd so I spent a little time looking
>> at this and I agree with Serge.
>>
>> > > [host:/dev/cgroup]$ pwd/dev/cgroup
>> > >
>> > > But the user process is up and running..
>> > >
>> > > [host:/dev/cgroup]$ ps aux | grep procroot
>>
>> > >
>> > > 693  0.0  0.4  34720  1112 ttyS0    Sl
>> 19:11   0:00 /opt/bin/myproc -ext
>> > >
>> > > Also the cgroup exists and valid..
>> > >
>> > > [host:/dev/cgroup]$ ls | grep hello-test
>> > > hello-test
>> > >
>> > > What above error mean and any suggestions ?
>> > > Please email.
>> >
>> > Which cgroups do you have composed on that
>> mount?  I'm guess you
>> > have cpuset, and you need to set the cpuset.mems and
>> cpuset.cpus.
>> > Until you do that, no tasks can be assigned to it.
>>
>> I looked a a few places in kernel/cgroup.c which return
>> ENOSPC
>> or could potentially forward such an error. The only place
>> that
>> fits is in the attach path and is consistent with the
>> notion that
>> it's a cpuset issue:
>>
>> echo <pid> > tasks =>
>> cgroup_tasks_write() =>
>> attach_task_by_pid() =>
>> cgroup_attach_task() => (via ss->can_attach() where
>> ss is the cpuset subsystem)
>> cpuset_can_attach():
>>         if
>> (cpumask_empty(cs->cpus_allowed) ||
>> nodes_empty(cs->mems_allowed))
>>
>> return -ENOSPC;
>>
>> No other cgroup subsystem that I looked at (freezer,
>> memcontrol, ns,
>>     blkio, devcgroup) returns ENOSPC when
>> attaching a task.
>>
>> So not only do you need to set those masks but each mask
>> must have at
>> least one cpu and "mem" respectively.
>>
>> Cheers,
>>     -Matt Helsley
>>
>
>
>
> _______________________________________________
> Containers mailing list
> Containers@lists.linux-foundation.org
> https://lists.linux-foundation.org/mailman/listinfo/containe rs
>



--
Jue Hong (洪爵)
Department of Network Infrastructure
Tencent Company, Shenzhen, China
_______________________________________________
Containers mailing list
Containers@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containe rs
Re: cgroup tasks file error [message #41936 is a reply to message #41930] Tue, 14 December 2010 17:17 Go to previous messageGo to next message
ccmail111 is currently offline  ccmail111
Messages: 10
Registered: December 2010
Junior Member
The uid is already root as below,

$ id
uid=0(root) gid=0(root) groups=0(root)


--- On Tue, 12/14/10, Greg Kurz <gkurz@fr.ibm.com> wrote:

> From: Greg Kurz <gkurz@fr.ibm.com>
> Subject: Re: cgroup tasks file error
> To: "Li Zefan" <lizf@cn.fujitsu.com>
> Cc: "ccmail111" <ccmail111@yahoo.com>, containers@lists.linux-foundation.org
> Date: Tuesday, December 14, 2010, 4:31 AM
> On 12/14/2010 02:34 AM, Li Zefan
> wrote:
> > Try:
> >
> >    $ sudo echo 580>  tasks
>
> Hmmm... you probably mean:
>
> sudo sh -c 'echo 580> tasks'
>
> Cheers.
>
> -- Gregory Kurz           
>                
>          gkurz@fr.ibm.com
> Software Engineer @ IBM/Meiosys       
>           http://www.ibm.com
> Tel +33 (0)534 638 479         
>              
>    Fax +33 (0)561 400 420
>
> "Anarchy is about taking complete responsibility for
> yourself."
>         Alan Moore.
>



_______________________________________________
Containers mailing list
Containers@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containe rs
Re: cgroup tasks file error [message #41937 is a reply to message #41935] Tue, 14 December 2010 17:33 Go to previous messageGo to next message
ccmail111 is currently offline  ccmail111
Messages: 10
Registered: December 2010
Junior Member
Isn't ns mounted by default ?
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 !?




--- On Tue, 12/14/10, Jue Hong <honshj@gmail.com> wrote:

> From: Jue Hong <honshj@gmail.com>
> Subject: Re: cgroup tasks file error
> To: "ccmail111" <ccmail111@yahoo.com>
> Cc: "Serge E. Hallyn" <serge.hallyn@canonical.com>, "Matt Helsley" <matthltc@us.ibm.com>, containers@lists.linux-foundation.org
> Date: Tuesday, December 14, 2010, 4:39 AM
> Have you mounted the ns subsys?
> The ns subsys will place some restrictions on the task
> movement.
>
> On Tue, Dec 14, 2010 at 3:28 PM, ccmail111 <ccmail111@yahoo.com>
> wrote:
> >
> > Thanks Matt.
> > After doing what Serge suggests, I was able to create
> a dummy cgroup and
> > move task (#580) below to the group. But now..
> > I see another issue: cannot move the task back to its
> parent (root), from the group (hello) as in:
> >
> > I am trying to move back task #580..
> >
> > [host:/dev/cgroup]$ id
> > uid=0(root) gid=0(root) groups=0(root)
> >
> >
> > [host:/dev/cgroup]$ echo 580 > tasks
> > -bash: echo: write error: Operation not permitted
> >
> > [host:/dev/cgroup]$ cat hello/tasks
> > 580
> > 610
> > 2104
> > [host:/dev/cgroup]$
> >
> >
> > --- On Mon, 12/13/10, Matt Helsley <matthltc@us.ibm.com>
> wrote:
> >
> >> From: Matt Helsley <matthltc@us.ibm.com>
> >> Subject: Re: cgroup tasks file error
> >> To: "Serge E. Hallyn" <serge.hallyn@canonical.com>
> >> Cc: "ccmail111" <ccmail111@yahoo.com>,
> containers@lists.linux-foundation.org
> >> Date: Monday, December 13, 2010, 8:02 PM
> >> On Mon, Dec 13, 2010 at 05:16:28PM
> >> -0600, Serge E. Hallyn wrote:
> >> > Quoting ccmail111 (ccmail111@yahoo.com):
> >> > >
> >> > > I see error:[host:/dev/cgroup]$ echo 693
> >
> >> hello-test/tasks
> >> > > -bash: echo: write error: No space left
> on
> >> device
> >>
> >> This does seem quite odd so I spent a little time
> looking
> >> at this and I agree with Serge.
> >>
> >> > > [host:/dev/cgroup]$ pwd/dev/cgroup
> >> > >
> >> > > But the user process is up and
> running..
> >> > >
> >> > > [host:/dev/cgroup]$ ps aux | grep
> procroot
> >>
> >> > >
> >> > > 693  0.0  0.4  34720  1112 ttyS0  
>  Sl
> >> 19:11   0:00 /opt/bin/myproc -ext
> >> > >
> >> > > Also the cgroup exists and valid..
> >> > >
> >> > > [host:/dev/cgroup]$ ls | grep
> hello-test
> >> > > hello-test
> >> > >
> >> > > What above error mean and any
> suggestions ?
> >> > > Please email.
> >> >
> >> > Which cgroups do you have composed on that
> >> mount?  I'm guess you
> >> > have cpuset, and you need to set the
> cpuset.mems and
> >> cpuset.cpus.
> >> > Until you do that, no tasks can be assigned
> to it.
> >>
> >> I looked a a few places in kernel/cgroup.c which
> return
> >> ENOSPC
> >> or could potentially forward such an error. The
> only place
> >> that
> >> fits is in the attach path and is consistent with
> the
> >> notion that
> >> it's a cpuset issue:
> >>
> >> echo <pid> > tasks =>
> >> cgroup_tasks_write() =>
> >> attach_task_by_pid() =>
> >> cgroup_attach_task() => (via
> ss->can_attach() where
> >> ss is the cpuset subsystem)
> >> cpuset_can_attach():
> >>         if
> >> (cpumask_empty(cs->cpus_allowed) ||
> >> nodes_empty(cs->mems_allowed))
> >>
> >> return -ENOSPC;
> >>
> >> No other cgroup subsystem that I looked at
> (freezer,
> >> memcontrol, ns,
> >>     blkio, devcgroup) returns ENOSPC when
> >> attaching a task.
> >>
> >> So not only do you need to set those masks but
> each mask
> >> must have at
> >> least one cpu and "mem" respectively.
> >>
> >> Cheers,
> >>     -Matt Helsley
> >>
> >
> >
> >
> > _______________________________________________
> > Containers mailing list
> > Containers@lists.linux-foundation.org
> > https://lists.linux-foundation.org/mailman/listinfo/containe rs
> >
>
>
>
> --
> Jue Hong (洪爵)
> Department of Network Infrastructure
> Tencent Company, Shenzhen, China
>



_______________________________________________
Containers mailing list
Containers@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containe rs
Re: cgroup tasks file error [message #41938 is a reply to message #41930] Tue, 14 December 2010 18:22 Go to previous messageGo to next message
ccmail111 is currently offline  ccmail111
Messages: 10
Registered: December 2010
Junior Member
--- On Tue, 12/14/10, Balbir Singh <balbir@linux.vnet.ibm.com> wrote:

> From: Balbir Singh <balbir@linux.vnet.ibm.com>
> Subject: Re: cgroup tasks file error
> To: "ccmail111" <ccmail111@yahoo.com>
> Cc: "Jue Hong" <honshj@gmail.com>, containers@lists.linux-foundation.org
> Date: Tuesday, December 14, 2010, 12:41 PM
> On Tue, Dec 14, 2010 at 11:03 PM,
> ccmail111 <ccmail111@yahoo.com>
> wrote:
> >
> > Isn't ns mounted by default ?
> > 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
>
> Can you paste the output of
>
> cat /dev/cgroup/hello/cpuset.cpus and mems.
>
> Also please paste the o/p of /dev/cgroup/cpuset.cpus and
> 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
>
> can you send us the o/p of
>
> ls -al /dev/cgroup
>
> and ls -al /dev/cgroup/hello
>
> Balbir
>
----

Please find output requested below:


[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:~]$ echo 575 > /dev/cgroup/tasks
-bash: echo: write error: Operation not permitted
[host:~]$ cat /dev/cgroup/hello/cpuset.cpus
0
[host:~]$ cat /dev/cgroup/hello/cpuset.mems
0
[host:~]$ cat /dev/cgroup/cpuset.mems
0
[host:~]$ cat /dev/cgroup/cpuset.cpus
0
[host:~]$ ls -al /dev/cgroup/
total 0
drwxr-xr-x 3 root root 0 Dec 14 17:29 .
drwxr-xr-x 11 root root 2980 Dec 14 17:29 ..
-r--r--r-- 1 root root 0 Dec 14 17:29 cgroup.procs
-rw-r--r-- 1 root root 0 Dec 14 17:29 cpuset.cpu_exclusive
-rw-r--r-- 1 root root 0 Dec 14 17:29 cpuset.cpus
-rw-r--r-- 1 root root 0 Dec 14 17:29 cpuset.mem_exclusive
-rw-r--r-- 1 root root 0 Dec 14 17:29 cpuset.mem_hardwall
-rw-r--r-- 1 root root 0 Dec 14 17:29 cpuset.memory_migrate
-r--r--r-- 1 root root 0 Dec 14 17:29 cpuset.memory_pressure
-rw-r--r-- 1 root root 0 Dec 14 17:29 cpuset.memory_pressure_enabled
-rw-r--r-- 1 root root 0 Dec 14 17:29 cpuset.memory_spread_page
-rw-r--r-- 1 root root 0 Dec 14 17:29 cpuset.memory_spread_slab
-rw-r--r-- 1 root root 0 Dec 14 17:29 cpuset.mems
-rw-r--r-- 1 root root 0 Dec 14 17:29 cpuset.sched_load_balance
-rw-r--r-- 1 root root 0 Dec 14 17:29 cpuset.sched_relax_domain_level
drwxr-xr-x 2 root root 0 Dec 14 17:29 hello
-rw-r--r-- 1 root root 0 Dec 14 17:29 notify_on_release
-rw-r--r-- 1 root root 0 Dec 14 17:29 release_agent
-rw-r--r-- 1 root root 0 Dec 14 17:31 tasks
[host:~]$ ls -al /dev/cgroup/hello/
total 0
drwxr-xr-x 2 root root 0 Dec 14 17:29 .
drwxr-xr-x 3 root root 0 Dec 14 17:29 ..
-r--r--r-- 1 root root 0 Dec 14 17:29 cgroup.procs
-rw-r--r-- 1 root root 0 Dec 14 17:29 cpuset.cpu_exclusive
-rw-r--r-- 1 root root 0 Dec 14 17:30 cpuset.cpus
-rw-r--r-- 1 root root 0 Dec 14 17:29 cpuset.mem_exclusive
-rw-r--r-- 1 root root 0 Dec 14 17:29 cpuset.mem_hardwall
-rw-r--r-- 1 root root 0 Dec 14 17:29 cpuset.memory_migrate
-r--r--r-- 1 root root 0 Dec 14 17:29 cpuset.memory_pressure
-rw-r--r-- 1 root root 0 Dec 14 17:29 cpuset.memory_spread_page
-rw-r--r-- 1 root root 0 Dec 14 17:29 cpuset.memory_spread_slab
-rw-r--r-- 1 root root 0 Dec 14 17:30 cpuset.mems
-rw-r--r-- 1 root root 0 Dec 14 17:29 cpuset.sched_load_balance
-rw-r--r-- 1 root root 0 Dec 14 17:29 cpuset.sched_relax_domain_level
-rw-r--r-- 1 root root 0 Dec 14 17:29 notify_on_release
-rw-r--r-- 1 root root 0 Dec 14 17:30 tasks
[host:~]$ id
uid=0(root) gid=0(root) groups=0(root)
[host:~]$




_______________________________________________
Containers mailing list
Containers@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containe rs
Re: cgroup tasks file error [message #41939 is a reply to message #41930] Tue, 14 December 2010 19:23 Go to previous messageGo to next 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
Re: cgroup tasks file error [message #41940 is a reply to message #41930] Wed, 15 December 2010 22:08 Go to previous message
ccmail111 is currently offline  ccmail111
Messages: 10
Registered: December 2010
Junior Member
--- On Wed, 12/15/10, Balbir Singh <balbir@linux.vnet.ibm.com> wrote:

> From: Balbir Singh <balbir@linux.vnet.ibm.com>
> Subject: Re: cgroup tasks file error
> To: "ccmail111" <ccmail111@yahoo.com>
> Cc: containers@lists.linux-foundation.org
> Date: Wednesday, December 15, 2010, 12:51 PM
> * ccmail111 <ccmail111@yahoo.com>
> [2010-12-14 10:22:32]:
>
> >
> >
> > --- On Tue, 12/14/10, Balbir Singh <balbir@linux.vnet.ibm.com>
> wrote:
> >
> > > From: Balbir Singh <balbir@linux.vnet.ibm.com>
> > > Subject: Re: cgroup tasks file error
> > > To: "ccmail111" <ccmail111@yahoo.com>
> > > Cc: "Jue Hong" <honshj@gmail.com>,
> containers@lists.linux-foundation.org
> > > Date: Tuesday, December 14, 2010, 12:41 PM
> > > On Tue, Dec 14, 2010 at 11:03 PM,
> > > ccmail111 <ccmail111@yahoo.com>
> > > wrote:
> > > >
> > > > Isn't ns mounted by default ?
> > > > 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
> > >
> > > Can you paste the output of
> > >
> > > cat /dev/cgroup/hello/cpuset.cpus and mems.
> > >
> > > Also please paste the o/p of
> /dev/cgroup/cpuset.cpus and
> > > 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
> > >
> > > can you send us the o/p of
> > >
> > > ls -al /dev/cgroup
> > >
> > > and ls -al /dev/cgroup/hello
> > >
> > > Balbir
> > >
> > ----
> >
> > Please find output requested below:
> >
> >
> > [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:~]$ echo 575 > /dev/cgroup/tasks
> > -bash: echo: write error: Operation not permitted
> > [host:~]$ cat /dev/cgroup/hello/cpuset.cpus
> > 0
> > [host:~]$ cat /dev/cgroup/hello/cpuset.mems
> > 0
> > [host:~]$ cat /dev/cgroup/cpuset.mems
> > 0
> > [host:~]$ cat /dev/cgroup/cpuset.cpus
> > 0
> > [host:~]$ ls -al /dev/cgroup/
> > total 0
> > drwxr-xr-x  3 root root    0 Dec 14
> 17:29 .
> > drwxr-xr-x 11 root root 2980 Dec 14 17:29 ..
> > -r--r--r--  1 root root    0 Dec 14
> 17:29 cgroup.procs
> > -rw-r--r--  1 root root    0 Dec 14
> 17:29 cpuset.cpu_exclusive
> > -rw-r--r--  1 root root    0 Dec 14
> 17:29 cpuset.cpus
> > -rw-r--r--  1 root root    0 Dec 14
> 17:29 cpuset.mem_exclusive
> > -rw-r--r--  1 root root    0 Dec 14
> 17:29 cpuset.mem_hardwall
> > -rw-r--r--  1 root root    0 Dec 14
> 17:29 cpuset.memory_migrate
> > -r--r--r--  1 root root    0 Dec 14
> 17:29 cpuset.memory_pressure
> > -rw-r--r--  1 root root    0 Dec 14
> 17:29 cpuset.memory_pressure_enabled
> > -rw-r--r--  1 root root    0 Dec 14
> 17:29 cpuset.memory_spread_page
> > -rw-r--r--  1 root root    0 Dec 14
> 17:29 cpuset.memory_spread_slab
> > -rw-r--r--  1 root root    0 Dec 14
> 17:29 cpuset.mems
> > -rw-r--r--  1 root root    0 Dec 14
> 17:29 cpuset.sched_load_balance
> > -rw-r--r--  1 root root    0 Dec 14
> 17:29 cpuset.sched_relax_domain_level
> > drwxr-xr-x  2 root root    0 Dec 14
> 17:29 hello
> > -rw-r--r--  1 root root    0 Dec 14
> 17:29 notify_on_release
> > -rw-r--r--  1 root root    0 Dec 14
> 17:29 release_agent
> > -rw-r--r--  1 root root    0 Dec 14
> 17:31 tasks
> > [host:~]$ ls -al /dev/cgroup/hello/
> > total 0
> > drwxr-xr-x 2 root root 0 Dec 14 17:29 .
> > drwxr-xr-x 3 root root 0 Dec 14 17:29 ..
> > -r--r--r-- 1 root root 0 Dec 14 17:29 cgroup.procs
> > -rw-r--r-- 1 root root 0 Dec 14 17:29
> cpuset.cpu_exclusive
> > -rw-r--r-- 1 root root 0 Dec 14 17:30 cpuset.cpus
> > -rw-r--r-- 1 root root 0 Dec 14 17:29
> cpuset.mem_exclusive
> > -rw-r--r-- 1 root root 0 Dec 14 17:29
> cpuset.mem_hardwall
> > -rw-r--r-- 1 root root 0 Dec 14 17:29
> cpuset.memory_migrate
> > -r--r--r-- 1 root root 0 Dec 14 17:29
> cpuset.memory_pressure
> > -rw-r--r-- 1 root root 0 Dec 14 17:29
> cpuset.memory_spread_page
> > -rw-r--r-- 1 root root 0 Dec 14 17:29
> cpuset.memory_spread_slab
> > -rw-r--r-- 1 root root 0 Dec 14 17:30 cpuset.mems
> > -rw-r--r-- 1 root root 0 Dec 14 17:29
> cpuset.sched_load_balance
> > -rw-r--r-- 1 root root 0 Dec 14 17:29
> cpuset.sched_relax_domain_level
> > -rw-r--r-- 1 root root 0 Dec 14 17:29
> notify_on_release
> > -rw-r--r-- 1 root root 0 Dec 14 17:30 tasks
> > [host:~]$ id
> > uid=0(root) gid=0(root) groups=0(root)
> > [host:~]$
> >
>
> Looks like Serge's ns suggestion solved your problem,
> right?
>
> --
>     Three Cheers,
>     Balbir
>

Yes, Balbir, thats right.

IMHO, it would nice if it can be documented on wiki or such.
Thanks everyone for suggestions..



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


Current Time: Wed Jul 30 09:22:49 GMT 2025

Total time taken to generate the page: 0.05651 seconds