On 08/12/2010 10:36 AM, Balbir Singh wrote:
> * Ivana Varekova<[email protected]>  [2010-08-09 14:49:37]:
>
>    
>> CHANGELOG v1
>> * more verbose comments
>> * tune the variable names/description/usage in display_controller_data 
>> function
>> * remove unnecesary .stat exception
>>
>> SYNOPSIS:
>> cgsnapshot [-h] [-n] [controller] [...]
>> Generate the configuration file from the current hierarchie(s) of control 
>> groups
>>    -h, --help                Display this help
>>    -n, --no-errors   Omit the output
>> the output have the same format as cgconfig.conf file (the values are in 
>> commas)
>>
>> EXAMPLE:
>> $ /home/varekova/bg/libcgroup/20100719/libcg/src/tools/cgsnapshot -n
>> # Configuration file generated by cgsnapshot
>> mount {
>>       cpuset = /cgroup/cpuset;
>>       cpu = /cgroup/devices;
>>       cpuacct = /cgroup/memoryd;
>>       memory = /cgroup/memory;
>>       devices = /cgroup/devices;
>>       freezer = /cgroup/freezer;
>>       net_cls = /cgroup/net_cls;
>> }
>>
>> group daemons {
>>      perm {
>>              admin {
>>                      uid = root;
>>                      gid = root;
>>              }
>>              task {
>>                      uid = root;
>>                      gid = root;
>>              }
>>      }
>>      cpuset {
>>              cpuset.memory_spread_slab="0";
>>              cpuset.memory_spread_page="0";
>>              cpuset.memory_migrate="0";
>>              cpuset.sched_relax_domain_level="-1";
>>              cpuset.sched_load_balance="1";
>>              cpuset.mem_hardwall="0";
>>              cpuset.mem_exclusive="0";
>>              cpuset.cpu_exclusive="0";
>>      }
>> }
>>
>>      
> Is this a generated sample? BTW, I ran the code through the generated
> hierarchy from samples/large_cgconfig.conf and took a snapshot. Then I
> loaded the snapshot using cgconfigparser, the load failed.
>    
The problem with samples/large_cgconfig.conf are the duplicate groups:
cgsnapshot do separate  group definitions for all control groups in 
separate hierarchies, but
cgconfigparser allows only one  group definition for each control group 
name. In this example there are groups with the same name in two 
different hierarchies, so cgsnapshot write two  group definitions.

 From my point of view it is cgconfigparser problem. It should enable to 
have several  group definitions for control group with the same name. 
Otherwise it is not possible to create two control groups with the same 
name and the different permissions.
> I also found that we generate duplicate groups -- one for each
> controller, we don't support that yet and I think it makes the final
> output hard to read and longer. Could you please write cgsnapshot in
> a way that integrates control files from each controller into one
> group {} in the generated file.
>    
I can add some option which will try to put the control groups with the 
same name to one group definition, but I'm not sure whether the users 
should prefer this version.

Ivana

------------------------------------------------------------------------------
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
Libcg-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libcg-devel

Reply via email to