* Can not remove the subdirectory in cgroup pseudo-filesystem
@ 2009-03-25 16:24 anqin
[not found] ` <d95d44a20903250924p2fb28afdq7ac47cac372c7de3-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
0 siblings, 1 reply; 6+ messages in thread
From: anqin @ 2009-03-25 16:24 UTC (permalink / raw)
To: Linux Containers
Dear all,
I have met a straight problem in my recent operation.
Previously, I can do the following operations:
# mount -t cgroup cgroup /mnt/cgrp
# cd /mnt/cgrp
# mkdir test
# echo $$ > test/tasks
# rm -rf test
but now I met the straight permission with the same
operation while I am root:
# mount -t cgroup cgroup /mnt/cgrp
# cd /mnt/cgrp
# mkdir test
# echo $$ > test/tasks
-bash: echo: write error: No space left on device
# rm -rf test
rm: cannot remove `/mnt/cgrp/test/cpuset.memory_spread_slab':
Operation not permitted
rm: cannot remove `/mnt/cgrp/test/cpuset.memory_spread_page':
Operation not permitted
rm: cannot remove `/mnt/cgrp/test/cpuset.memory_pressure': Operation
not permitted
...
I guess maybe the permission attributes block my operation, but I
checked with lsattr
and got the following message:
# lsattr /mnt/cgrp/test
lsattr: Inappropriate ioctl for device While reading flags on
/mnt/cgrp/test/cpuset.memory_spread_slab
lsattr: Inappropriate ioctl for device While reading flags on
/mnt/cgrp/test/cpuset.memory_spread_page
lsattr: Inappropriate ioctl for device While reading flags on
/mnt/cgrp/test/cpuset.memory_pressure
...
I have no idea how to fix it. Any help?
Thank you very much,
Anqin
^ permalink raw reply [flat|nested] 6+ messages in thread[parent not found: <d95d44a20903250924p2fb28afdq7ac47cac372c7de3-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>]
* Re: Can not remove the subdirectory in cgroup pseudo-filesystem [not found] ` <d95d44a20903250924p2fb28afdq7ac47cac372c7de3-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> @ 2009-03-25 16:37 ` Serge E. Hallyn [not found] ` <20090325163702.GA17626-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org> 0 siblings, 1 reply; 6+ messages in thread From: Serge E. Hallyn @ 2009-03-25 16:37 UTC (permalink / raw) To: anqin; +Cc: Linux Containers Quoting anqin (anqin.qin-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org): > Dear all, > > I have met a straight problem in my recent operation. > Previously, I can do the following operations: > > # mount -t cgroup cgroup /mnt/cgrp > # cd /mnt/cgrp > # mkdir test > # echo $$ > test/tasks > # rm -rf test I doubt this ever worked - rather, you have to do rmdir test rm -rf will try to delete the files under test/ first, and fail. > > but now I met the straight permission with the same > operation while I am root: > > # mount -t cgroup cgroup /mnt/cgrp > # cd /mnt/cgrp > # mkdir test > # echo $$ > test/tasks Yes you have to initialize some cpuset files first. Otherwise the tasks have no access to any memory or cpus. echo 0 > /cgroup/1/cpuset.mems echo 0-3 > /cgroup/1/cpuset.cpus echo $$ > /cgroup/1//tasks (success) > -bash: echo: write error: No space left on device > # rm -rf test > rm: cannot remove `/mnt/cgrp/test/cpuset.memory_spread_slab': > Operation not permitted > rm: cannot remove `/mnt/cgrp/test/cpuset.memory_spread_page': > Operation not permitted > rm: cannot remove `/mnt/cgrp/test/cpuset.memory_pressure': Operation > not permitted > ... > > I guess maybe the permission attributes block my operation, but I > checked with lsattr > and got the following message: > > # lsattr /mnt/cgrp/test > lsattr: Inappropriate ioctl for device While reading flags on > /mnt/cgrp/test/cpuset.memory_spread_slab > lsattr: Inappropriate ioctl for device While reading flags on > /mnt/cgrp/test/cpuset.memory_spread_page > lsattr: Inappropriate ioctl for device While reading flags on > /mnt/cgrp/test/cpuset.memory_pressure > ... > > I have no idea how to fix it. Any help? > > Thank you very much, > > Anqin > _______________________________________________ > Containers mailing list > Containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org > https://lists.linux-foundation.org/mailman/listinfo/containers ^ permalink raw reply [flat|nested] 6+ messages in thread
[parent not found: <20090325163702.GA17626-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>]
* Re: Can not remove the subdirectory in cgroup pseudo-filesystem [not found] ` <20090325163702.GA17626-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org> @ 2009-03-25 17:11 ` anqin [not found] ` <d95d44a20903251011u5786c780wb3a0a0cc3b759689-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> 0 siblings, 1 reply; 6+ messages in thread From: anqin @ 2009-03-25 17:11 UTC (permalink / raw) To: Serge E. Hallyn; +Cc: Linux Containers > > 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 bash_B). Now, in bash_A, I created a cgroup in procfs: # mount -t cgroup cgroup /mnt/cgrp # 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 It seems the cgroup can not couple two irrelevant task together, right? Best, Anqin ^ permalink raw reply [flat|nested] 6+ messages in thread
[parent not found: <d95d44a20903251011u5786c780wb3a0a0cc3b759689-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>]
* Re: Can not remove the subdirectory in cgroup pseudo-filesystem [not found] ` <d95d44a20903251011u5786c780wb3a0a0cc3b759689-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> @ 2009-03-26 1:15 ` Li Zefan [not found] ` <49CAD714.4080307-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org> 0 siblings, 1 reply; 6+ messages in thread From: Li Zefan @ 2009-03-26 1:15 UTC (permalink / raw) To: anqin; +Cc: Linux Containers 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. > It seems the cgroup can not couple two irrelevant > task together, right? > > > Best, > > Anqin ^ permalink raw reply [flat|nested] 6+ messages in thread
[parent not found: <49CAD714.4080307-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>]
* Re: Can not remove the subdirectory in cgroup pseudo-filesystem [not found] ` <49CAD714.4080307-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org> @ 2009-03-26 1:51 ` Serge E. Hallyn 2009-03-27 3:06 ` anqin 1 sibling, 0 replies; 6+ messages in thread From: Serge E. Hallyn @ 2009-03-26 1:51 UTC (permalink / raw) To: Li Zefan; +Cc: Linux Containers 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 ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Can not remove the subdirectory in cgroup pseudo-filesystem [not found] ` <49CAD714.4080307-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org> 2009-03-26 1:51 ` Serge E. Hallyn @ 2009-03-27 3:06 ` anqin 1 sibling, 0 replies; 6+ messages in thread From: anqin @ 2009-03-27 3:06 UTC (permalink / raw) To: Li Zefan; +Cc: Linux Containers Thank you, when I mount all cgroup subsystem to cgroupfs, it mounts also the ns_cgroup which blocks the adding new taskes into given cgroup. If I mount a single subsystem (such as a memory), it can work. >> # 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. > ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2009-03-27 3:06 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-25 16:24 Can not remove the subdirectory in cgroup pseudo-filesystem anqin
[not found] ` <d95d44a20903250924p2fb28afdq7ac47cac372c7de3-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-03-25 16:37 ` Serge E. Hallyn
[not found] ` <20090325163702.GA17626-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2009-03-25 17:11 ` anqin
[not found] ` <d95d44a20903251011u5786c780wb3a0a0cc3b759689-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-03-26 1:15 ` Li Zefan
[not found] ` <49CAD714.4080307-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
2009-03-26 1:51 ` Serge E. Hallyn
2009-03-27 3:06 ` anqin
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.