Hi, All,
I've been experimenting with task migration in cgroups and hit a
strange problem
1. By default all classes belong to the root group
2. When I migrate a group to a different group (I can migrate based on
permissions)
3. But when I am done, I can't migrate back to the root group since
all of it is owned by root
I am playing around with a fix that allows creation of a /default
group and using cgrulesengd, we can classify all tasks to /default. I
propose giving world read, write permissions to /default/tasks, so
that a class can return back home when it is done with its work in
other groups. I faced this issue when I created a thread pool and used
different threads to move to various groups, but in the end they had
no place to return back to :(
Here is a proposed fix. Thoughts? Comments? Flames?
Index: scripts/init.d/cgconfig
===================================================================
--- scripts/init.d/cgconfig (revision 225)
+++ scripts/init.d/cgconfig (working copy)
@@ -81,6 +81,19 @@
then
#log_progress_msg "Starting cgconfig service: "
cgconfigparser -l $CONFIG_FILE
+ #
+ # Create a default class for tasks to return back to
+ #
+ parse_mounts
+ for i in `seq 1 $maxindex`
+ do
+ #
+ # Ignore if directory already exists
+ #
+ mkdir ${MOUNTPOINT[$i]}/default 2> /dev/null
+ chmod a+rw ${MOUNTPOINT[$i]}/default/tasks
+ done
+
fi
[ $? == 0 ] && touch /var/lock/subsys/$servicename
return $?
--
Balbir
------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you. Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
Libcg-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libcg-devel