cgroup tasks file error
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
A message that is not in the archive (sent off-list or not yet received): 149701.57773.qm-VjZBGxy5l2evuULXzWHTWIglqE1Y4D90QQ4Iyu8u01E@public.gmane.org
Quoted 11 lines · Quoting ccmail111 (ccmail111-/[email protected]):
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/cgroupBut the user process is up and running..
[host:/dev/cgroup]$ ps aux | grep procroot693 0.0 0.4 34720 1112 ttyS0 Sl 19:11 0:00
/opt/bin/myproc-ext
Quoted 7 lines
Also the cgroup exists and valid..
[host:/dev/cgroup]$ ls | grep hello-test hello-testWhat 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
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 4 lines · Serge E. Hallyn
Quoted 3 lines · Quoting ccmail111 (ccmail111-/[email protected]):
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.
Quoted 13 lines
Quoted 13 lines
[host:/dev/cgroup]$ pwd/dev/cgroupBut the user process is up and running..
[host:/dev/cgroup]$ ps aux | grep procroot693 0.0 0.4 34720 1112 ttyS0 Sl 19:11 0:00
/opt/bin/myproc-extAlso the cgroup exists and valid..
[host:/dev/cgroup]$ ls | grep hello-test hello-test
Quoted 6 lines
Quoted 2 lines
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
A message that is not in the archive (sent off-list or not yet received): 20101214010243.GC26523-52DBMbEzqgQ/wnmkkaCWp/[email protected]
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]$
Quoted 73 lines · Matt Helsley
From: Matt Helsley <matthltc-r/[email protected]>
Subject: Re: cgroup tasks file error
To: "Serge E. Hallyn" <[email protected]>
Cc: "ccmail111" <ccmail111-/[email protected]>, [email protected]
Date: Monday, December 13, 2010, 8:02 PMQuoted 3 lines · Serge E. Hallyn
Quoted 2 lines · Quoting ccmail111 (ccmail111-/[email protected]):
I see error:[host:/dev/cgroup]$ echo 693 >
hello-test/tasks
Quoted 1 line
Quoted 1 line
-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.
Quoted 5 lines
Quoted 5 lines
[host:/dev/cgroup]$ pwd/dev/cgroupBut the user process is up and running..
[host:/dev/cgroup]$ ps aux | grep procrootQuoted 2 lines
Quoted 2 lines
693 0.0 0.4 34720 1112 ttyS0 Sl
19:11 0:00
/opt/bin/myproc-extQuoted 10 lines
Quoted 8 lines
Also the cgroup exists and valid..
[host:/dev/cgroup]$ ls | grep hello-test hello-testWhat above error mean and any suggestions ?
Please email.Which cgroups do you have composed on that
mount? I'm guess you
Quoted 1 line
have cpuset, and you need to set the cpuset.mems and
cpuset.cpus.
Quoted 1 line
Until you do that, no tasks can be assigned to it.
I looked a a few places in
kernel/cgroup.cwhich 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()=> (viass->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
A message that is not in the archive (sent off-list or not yet received): 464217.68381.qm-VjZBGxy5l2evuULXzWHTWIglqE1Y4D90QQ4Iyu8u01E@public.gmane.org
Have you mounted the ns subsys?
The ns subsys will place some restrictions on the task movement.
Quoted 105 lines · On Tue, Dec 14, 2010 at 3:28 PM, ccmail111 <[email protected]> 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]$Quoted 66 lines · Matt Helsley
From: Matt Helsley <[email protected]>
Subject: Re: cgroup tasks file error
To: "Serge E. Hallyn" <[email protected]>
Cc: "ccmail111" <[email protected]>, [email protected]
Date: Monday, December 13, 2010, 8:02 PMQuoted 3 lines · Serge E. Hallyn
Quoted 2 lines · Quoting ccmail111 ([email protected]):
I see error:[host:/dev/cgroup]$ echo 693 >
hello-test/tasks
Quoted 1 line
Quoted 1 line
-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.
Quoted 8 lines
Quoted 8 lines
[host:/dev/cgroup]$ pwd/dev/cgroupBut the user process is up and running..
[host:/dev/cgroup]$ ps aux | grep procroot693 0.0 0.4 34720 1112 ttyS0 Sl
19:11 0:00
/opt/bin/myproc-extQuoted 10 lines
Quoted 8 lines
Also the cgroup exists and valid..
[host:/dev/cgroup]$ ls | grep hello-test hello-testWhat above error mean and any suggestions ?
Please email.Which cgroups do you have composed on that
mount? I'm guess you
Quoted 1 line
have cpuset, and you need to set the cpuset.mems and
cpuset.cpus.
Quoted 1 line
Until you do that, no tasks can be assigned to it.
I looked a a few places in
kernel/cgroup.cwhich 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()=> (viass->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.Quoted 7 lines
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
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/containers
Signature · 7 lines
Jue Hong (洪爵) Department of Network Infrastructure Tencent Company, Shenzhen, China _______________________________________________ Containers mailing list [email protected] https://lists.linux-foundation.org/mailman/listinfo/containers
A message that is not in the archive (sent off-list or not yet received): AANLkTi=tpq0Jo9WAd5eu=fP2bLaSG6iLpHtAVR1xe=Ub-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
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 !?
Quoted 131 lines · Jue Hong
From: Jue Hong <[email protected]>
Subject: Re: cgroup tasks file error
To: "ccmail111" <[email protected]>
Cc: "Serge E. Hallyn" <[email protected]>, "Matt Helsley" <[email protected]>, [email protected]
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.Quoted 3 lines · On Tue, Dec 14, 2010 at 3:28 PM, ccmail111 <[email protected]> wrote:
Thanks Matt.
After doing what Serge suggests, I was able to createa dummy cgroup and
Quoted 2 lines
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:
Quoted 18 lines
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 <[email protected]>
Quoted 5 lines · wrote:
Quoted 5 lines
From: Matt Helsley <[email protected]>
Subject: Re: cgroup tasks file error
To: "Serge E. Hallyn" <[email protected]>
Cc: "ccmail111" <[email protected]>,Quoted 9 lines
Quoted 9 lines
Date: Monday, December 13, 2010, 8:02 PM
Quoted 3 lines · Serge E. Hallyn
Quoted 2 lines · Quoting ccmail111 ([email protected]):
I see error:[host:/dev/cgroup]$ echo 693
hello-test/tasks
Quoted 1 line
Quoted 1 line
-bash: echo: write error: No space left
on
Quoted 3 lines
Quoted 3 lines
device
This does seem quite odd so I spent a little time
looking
Quoted 5 lines
Quoted 5 lines
at this and I agree with Serge.
Quoted 3 lines
Quoted 3 lines
[host:/dev/cgroup]$ pwd/dev/cgroupBut the user process is up and
running..
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
[host:/dev/cgroup]$ ps aux | grepprocroot
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
693 0.0 0.4 34720 1112 ttyS0
Sl
Quoted 5 lines
Quoted 5 lines
19:11 0:00
/opt/bin/myproc-extQuoted 4 lines
Quoted 4 lines
Also the cgroup exists and valid..
[host:/dev/cgroup]$ ls | grephello-test
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
hello-test
What above error mean and any
suggestions ?
Quoted 5 lines
Quoted 5 lines
Quoted 3 lines
Quoted 1 line
Please email.
Which cgroups do you have composed on that
mount? I'm guess you
Quoted 1 line
have cpuset, and you need to set the
cpuset.mems and
Quoted 2 lines
Quoted 2 lines
cpuset.cpus.
Quoted 1 line
Until you do that, no tasks can be assigned
to it.
Quoted 2 lines
Quoted 2 lines
I looked a a few places in
kernel/cgroup.cwhichreturn
Quoted 2 lines
Quoted 2 lines
ENOSPC
or could potentially forward such an error. Theonly place
Quoted 2 lines
Quoted 2 lines
that
fits is in the attach path and is consistent withthe
Quoted 7 lines
Quoted 7 lines
notion that
it's a cpuset issue:echo <pid> > tasks =>
cgroup_tasks_write()=>attach_task_by_pid()=>cgroup_attach_task()=> (via
ss->can_attach()whereQuoted 9 lines
Quoted 9 lines
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,
Quoted 5 lines
Quoted 5 lines
memcontrol, ns,
blkio, devcgroup) returns ENOSPC when attaching a task.So not only do you need to set those masks but
each mask
Quoted 9 lines
Quoted 6 lines
must have at
least one cpu and "mem" respectively.Cheers,
-Matt Helsley
Quoted 13 lines
Quoted 5 lines
_______________________________________________
Containers mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/containersSignature · 3 lines
Jue Hong (洪爵) Department of Network Infrastructure Tencent Company, Shenzhen, China
_______________________________________________
Containers mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/containers
A message that is not in the archive (sent off-list or not yet received): 166364.22607.qm-VjZBGxy5l2evuULXzWHTWIglqE1Y4D90QQ4Iyu8u01E@public.gmane.org
Quoted 2 lines · Quoting ccmail111 (ccmail111-/[email protected]):
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 :)
Quoted 21 lines
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:~]$
Quoted 7 lines
Now, I try to move the task out - the parent/root:
[host:~]$ echo 575 > /dev/cgroup/tasks -bash: echo: write error: Operation not permittedAny thoughts !?
Yes, ns cgroup is forbidding you from moving back :) Mount without it.
-serge
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 !
Quoted 60 lines · Serge Hallyn
From: Serge Hallyn <[email protected]>
Subject: Re: cgroup tasks file error
To: "ccmail111" <ccmail111-/[email protected]>
Cc: "Jue Hong" <[email protected]>, "Matt Helsley" <matthltc-r/[email protected]>, containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org
Date: Tuesday, December 14, 2010, 12:40 PMQuoted 2 lines · Quoting ccmail111 (ccmail111-/[email protected]):
Isn't ns mounted by default ?
I thought that in an earlier email you said you had done
mount -t cgroup cpuset -ocpuset
/dev/cgroupin which case ns would not be mounted. But note, we DO NOT
want you to have ns mounted :)Quoted 7 lines
I rebooted machine,
based on 2.6.32 kernel.Then,
[host:~]$ mkdir /dev/cgroup [host:~]$ mount -t cgroup cpuset -ocpuset,ns
/dev/cgroupQuoted 2 lines
[host:~]$ ps aux | grep libvirt root 5750.6 0.9 88816 2216 ?
Sl 17:28 0:00
myproc --daemonQuoted 1 line
root 654
0.0 0.2 4044 664
ttyS0
S+ 17:29 0:00 grep
libvirtQuoted 11 lines
[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:~]$Quoted 7 lines
Now, I try to move the task out - the parent/root:
[host:~]$ echo 575 > /dev/cgroup/tasks -bash: echo: write error: Operation not permittedAny thoughts !?
Yes, ns cgroup is forbidding you from moving back :) Mount without it.
-serge
Quoted 7 lines · On Tue, Dec 14, 2010 at 11:03 PM, ccmail111…
Isn't ns mounted by default ?
I rebooted machine,
based on 2.6.32 kernel.Then,
Quoted 9 lines
[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
Quoted 11 lines
[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
A message that is not in the archive (sent off-list or not yet received): AANLkTi=gR2JVXf0uidRMZo7s88th1wu-4+AbC0ZwRUJk-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
Quoted 47 lines · Balbir Singh
From: Balbir Singh <[email protected]>
Subject: Re: cgroup tasks file error
To: "ccmail111" <ccmail111-/[email protected]>
Cc: "Jue Hong" <[email protected]>, containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org
Date: Tuesday, December 14, 2010, 12:41 PMQuoted 9 lines · On Tue, Dec 14, 2010 at 11:03 PM, ccmail111…
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/cgroupQuoted 2 lines
[host:~]$ ps aux | grep libvirt root 575 0.6 0.9 88816 2216 ?Sl 17:28 0:00 myproc --daemon
Quoted 1 line
root 654 0.0 0.2 4044 664 ttyS0
S+ 17:29 0:00 grep libvirt
Quoted 4 lines
[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.memsCan you paste the output of
cat
/dev/cgroup/hello/cpuset.cpusand mems.Also please paste the o/p of
/dev/cgroup/cpuset.cpusand memsQuoted 11 lines
[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
Quoted 8 lines
can you send us the o/p of
ls -al
/dev/cgroupand ls -al
/dev/cgroup/helloBalbir
----
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:~]$
A message that is not in the archive (sent off-list or not yet received): 478906.58374.qm-NvXQCeNhX6ivuULXzWHTWIglqE1Y4D90QQ4Iyu8u01E@public.gmane.org
Quoted 122 lines · * ccmail111 <ccmail111-/[email protected]> [2010-12-14…
Quoted 47 lines · Balbir Singh
From: Balbir Singh <[email protected]>
Subject: Re: cgroup tasks file error
To: "ccmail111" <ccmail111-/[email protected]>
Cc: "Jue Hong" <[email protected]>, containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org
Date: Tuesday, December 14, 2010, 12:41 PMQuoted 9 lines · On Tue, Dec 14, 2010 at 11:03 PM, ccmail111…
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/cgroupQuoted 2 lines
[host:~]$ ps aux | grep libvirt root 575 0.6 0.9 88816 2216 ?Sl 17:28 0:00 myproc --daemon
Quoted 1 line
root 654 0.0 0.2 4044 664 ttyS0
S+ 17:29 0:00 grep libvirt
Quoted 4 lines
[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.memsCan you paste the output of
cat
/dev/cgroup/hello/cpuset.cpusand mems.Also please paste the o/p of
/dev/cgroup/cpuset.cpusand memsQuoted 11 lines
[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 permittedQuoted 8 lines
can you send us the o/p of
ls -al
/dev/cgroupand ls -al
/dev/cgroup/helloBalbir
----
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 ..(quoted diff) +0
-13-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_leveldrwxr-xr-x 2 root root 0 Dec 14 17:29 hello
(quoted diff) +0
-3-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 ..(quoted diff) +0
-14-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
Quoted 4 lines
[host:~]$ id uid=0(root) gid=0(root) groups=0(root) [host:~]$
Looks like Serge's ns suggestion solved your problem, right?
Signature · 2 lines
Three Cheers, Balbir
A message that is not in the archive (sent off-list or not yet received): 20101215175158.GB9587-SINUvgVNF2CyUtPGxGje5AC/[email protected]
Quoted 168 lines · Balbir Singh
From: Balbir Singh <[email protected]>
Subject: Re: cgroup tasks file error
To: "ccmail111" <ccmail111-/[email protected]>
Cc: containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org
Date: Wednesday, December 15, 2010, 12:51 PM
* ccmail111 <ccmail111-/[email protected]> [2010-12-14 10:22:32]:Quoted 3 lines
--- On Tue, 12/14/10, Balbir Singh <[email protected]>
Quoted 5 lines · wrote:
Quoted 5 lines
From: Balbir Singh <[email protected]>
Subject: Re: cgroup tasks file error
To: "ccmail111" <ccmail111-/[email protected]>
Cc: "Jue Hong" <[email protected]>,containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org
Quoted 5 lines
Quoted 5 lines
Date: Tuesday, December 14, 2010, 12:41 PM
Quoted 1 line · On Tue, Dec 14, 2010 at 11:03 PM, ccmail111…
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
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
Quoted 3 lines
Quoted 3 lines
/dev/cgroupQuoted 2 lines
[host:~]$ ps aux | grep libvirt root 575 0.6 0.9 88816 2216?
Quoted 2 lines
Quoted 2 lines
Sl 17:28 0:00 myproc --daemon
Quoted 1 line
root 654 0.0 0.2 4044 664
ttyS0
Quoted 4 lines
Quoted 4 lines
S+ 17:29 0:00 grep libvirt
Quoted 3 lines
[host:~]$ mkdir /dev/cgroup/hello [host:~]$ cat /dev/cgroup/hello/tasks [host:~]$ echo 0 >
/dev/cgroup/hello/cpuset.cpusQuoted 1 line
Quoted 1 line
Quoted 1 line
[host:~]$ echo 0 >
/dev/cgroup/hello/cpuset.memsQuoted 6 lines
Quoted 6 lines
Can you paste the output of
cat
/dev/cgroup/hello/cpuset.cpusand mems.Also please paste the o/p of
/dev/cgroup/cpuset.cpusandQuoted 3 lines
Quoted 3 lines
mems
Quoted 1 line
[host:~]$ echo 575 >
/dev/cgroup/hello/tasksQuoted 7 lines
Quoted 7 lines
Quoted 7 lines
[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:
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
[host:~]$ echo 575 > /dev/cgroup/tasks -bash: echo: write error: Operation notpermitted
Quoted 28 lines
Quoted 9 lines
can you send us the o/p of
ls -al
/dev/cgroupand ls -al
/dev/cgroup/helloBalbir
----
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.memsQuoted 8 lines
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 1417:29 .
Quoted 2 lines
drwxr-xr-x 11 root root 2980 Dec 14 17:29 .. -r--r--r-- 1 root root 0 Dec 14
17:29 cgroup.procs
Quoted 1 line
-rw-r--r-- 1 root root 0 Dec 14
17:29 cpuset.cpu_exclusive
Quoted 1 line
-rw-r--r-- 1 root root 0 Dec 14
17:29 cpuset.cpus
Quoted 1 line
-rw-r--r-- 1 root root 0 Dec 14
17:29 cpuset.mem_exclusive
Quoted 1 line
-rw-r--r-- 1 root root 0 Dec 14
17:29 cpuset.mem_hardwall
Quoted 1 line
-rw-r--r-- 1 root root 0 Dec 14
17:29 cpuset.memory_migrate
Quoted 1 line
-r--r--r-- 1 root root 0 Dec 14
17:29 cpuset.memory_pressure
Quoted 1 line
-rw-r--r-- 1 root root 0 Dec 14
17:29 cpuset.memory_pressure_enabled
Quoted 1 line
-rw-r--r-- 1 root root 0 Dec 14
17:29 cpuset.memory_spread_page
Quoted 1 line
-rw-r--r-- 1 root root 0 Dec 14
17:29 cpuset.memory_spread_slab
Quoted 1 line
-rw-r--r-- 1 root root 0 Dec 14
17:29 cpuset.mems
Quoted 1 line
-rw-r--r-- 1 root root 0 Dec 14
17:29 cpuset.sched_load_balance
Quoted 1 line
-rw-r--r-- 1 root root 0 Dec 14
17:29 cpuset.sched_relax_domain_level
Quoted 1 line
drwxr-xr-x 2 root root 0 Dec 14
17:29 hello
Quoted 1 line
-rw-r--r-- 1 root root 0 Dec 14
17:29
notify_on_releaseQuoted 1 line
-rw-r--r-- 1 root root 0 Dec 14
17:29
release_agentQuoted 1 line
-rw-r--r-- 1 root root 0 Dec 14
17:31 tasks
Review
Quoted 6 lines
[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 ..(quoted diff) +0
-2-r--r--r-- 1 root root 0 Dec 14 17:29 cgroup.procs -rw-r--r-- 1 root root 0 Dec 14 17:29cpuset.cpu_exclusive
Review
Quoted 2 lines
(quoted diff) +0
-2-rw-r--r-- 1 root root 0 Dec 14 17:30 cpuset.cpus -rw-r--r-- 1 root root 0 Dec 14 17:29cpuset.mem_exclusive
Quoted 1 line
-rw-r--r-- 1 root root 0 Dec 14 17:29
cpuset.mem_hardwall
Quoted 1 line
-rw-r--r-- 1 root root 0 Dec 14 17:29
cpuset.memory_migrate
Quoted 1 line
-r--r--r-- 1 root root 0 Dec 14 17:29
cpuset.memory_pressure
Quoted 1 line
-rw-r--r-- 1 root root 0 Dec 14 17:29
cpuset.memory_spread_page
Quoted 1 line
-rw-r--r-- 1 root root 0 Dec 14 17:29
cpuset.memory_spread_slab
Review
Quoted 2 lines
(quoted diff) +0
-2-rw-r--r-- 1 root root 0 Dec 14 17:30 cpuset.mems -rw-r--r-- 1 root root 0 Dec 14 17:29cpuset.sched_load_balance
Quoted 1 line
-rw-r--r-- 1 root root 0 Dec 14 17:29
cpuset.sched_relax_domain_level
Quoted 1 line
-rw-r--r-- 1 root root 0 Dec 14 17:29
notify_on_release
Quoted 13 lines
Quoted 5 lines
-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?
Signature · 2 lines
Three Cheers, Balbir
Yes, Balbir, thats right.
IMHO, it would nice if it can be documented on wiki or such. Thanks everyone for suggestions..
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 !
Quoted 35 lines · Serge E. Hallyn
From: Serge E. Hallyn <[email protected]>
Subject: Re: cgroup tasks file error
To: "ccmail111" <ccmail111-/[email protected]>
Cc: containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org
Date: Monday, December 13, 2010, 6:16 PMQuoted 2 lines · Quoting ccmail111 (ccmail111-/[email protected]):
I see error:[host:/dev/cgroup]$ echo 693 >
hello-test/tasks
Quoted 8 lines
-bash: echo: write error: No space left on device
[host:/dev/cgroup]$ pwd/dev/cgroupBut the user process is up and running..
[host:/dev/cgroup]$ ps aux | grep procroot693 0.0 0.4 34720 1112 ttyS0 Sl 19:11
0:00
/opt/bin/myproc-extQuoted 8 lines
Also the cgroup exists and valid..
[host:/dev/cgroup]$ ls | grep hello-test hello-testWhat 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