Hi, when I test cgclear command with -l, I got a error report like this:

"cgclear failed with Success"

the following is my operation:

# lssubsys -m
cpu /cgroup/cpu

# lscgroup
cpu:/
cpu:/test

# cgclear -l config
cgclear failed with Success

the config context is:
# cat config
# Configuration file generated by cgsnapshot
mount {
        cpuset = /cgroup/cpu;
        cpu = /cgroup/cpu;
}

Reading the code, I know that before unmout the hierarchy the code will
check if the hierarchy is empty. Because cpuset is not mounted, so when
get the first controller of the mount point to walk over the hierarchy,
the function cg_build_path() gets null and the code returns ECGOTHER.
At this time the last_errno is 0, so we get the error message "cgclear
failed with Success".

if I change the order the controllers like this:

# cat config
# Configuration file generated by cgsnapshot
mount {
        cpu = /cgroup/cpu;
        cpuset = /cgroup/cpu;
}

# cgclear -l config3
#

# lssubsys -m
cpu /cgroup/cpu

# lscgroup
cpu:/
cpu:/test

now there is no error message, but because the hierarchy is not empty,
so the umount is not executed. (Is it more better to print some prompt messages
about the non-empty hierarchy to let user know what happen?). After delete
the test cgroup, the umount is executed successfully.

for the problem, it seems not suitable to add checking whether the subsystem is
mounted before walking the hierarchy, because umount operation doesn't care this
except the mount path. Do you have some ideas? :)








------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
Libcg-devel mailing list
Libcg-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libcg-devel

Reply via email to