Dhaval Giani wrote:
> On Wed, Feb 18, 2009 at 02:53:14PM +0100, Jan Safranek wrote:
>> Hello,
>>
>> see my questions inline...
>>
>> Dhaval Giani wrote:
>>> cgroup = cgroup_new_cgroup("a");
>> Can I assume that cgroup_list_controllers() with group '/' (or '.')
>> returns list of all controllers in the system? The code looks like it
>> could work...
>>
>
> This is not querying the file system. Just the data structure.
>
>> And is there a way, how to say that two controllers are mounted to the
>> same mount point and therefore share groups?
>>
>
> I did not get the question. I would expect this to be handled by
> cgconfigparser.
Let's say some application wants to display all hierarchies and using
pretty GUI let the user to delete a grup. It does not know anything and
wants to use libcgroup to get all the information needed to display
current state. Using your API it's possible to get list of controllers,
e.g. cpu, cpuacct and device. And using Balbir's walk feature, it can
separately read groups related to these controllers, getting three
distinct trees:
cpu:
|
+ first
+ second
|
+- subgroup
cpuacct:
|
+ first
+ second
|
+- subgroup
device:
|
+ first
+ second
But the application is not able to distinguish, if cpu and cpuacct are
mounted together, i.e. whether the kernel sees the state above or this:
cpu,cpuacct:
|
+ first
+ second
|
+- subgroup
device:
|
+ first
+ second
These two configurations are completely different and the application
user might want to see this difference before e.g. he/she deletes
cpuacct:second group.
Parsing cgconfig is IMHO not a way to go, it contains state of
hierarchies after reboot, which can be different to current state. The
right way is IMHO remember hierarchy index read from /proc/cgroups
during cgroup_init() and pass it somehow to application.
Jan
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Libcg-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libcg-devel