On 03/12/2010 11:28 AM, Jan Safranek wrote:
> On 03/12/2010 08:16 AM, Jan Safranek wrote:
> ...
>> libcgroup.h
>>     - does not declare anything, it just includes all the other files. In
>>       future, it might contain base of doxygen documentation (some
>>       introduction etc.)
>>
>> libcgroup/base.h
>>     - global macros and types, included by all other headers. Maybe it would 
>> be
>>       good idea to have this file without function declarations?
>>
>> libcgroup/config.h
>>     - configuration reading/unloading
>>
>> libcgroup/groups.h
>>     - group manipulation stuff (create/modify/delete/free, incl. controllers 
>> and
>>       get/set values)
>>
>> libcgroup/iterators.h
>>     - various walks, *_begin/next/end
>>
>> libcgroup/tasks.h
>>     - task classification, incl. rules cache manipulation
>>
>> I am still not satisfied with function declarations in 'base.h', especially
>> cgroup_get_subsys_mount_point... Should there be 'util.h' with such
>> functions?
>
> Looking at doxygen output, it would be also nice to have :
> libcgroup/errors.h
>        - the mighty enum{} with all error codes + functions like
>          cgroup get_last_errno and cgroup_strerror (= error handling
>          described in this file)
>
> libcgroup/init.h
>        -  cgroup_init and cgroup_get_subsys_mount_point (I haven't
>           found any better place for it...)
>
> As benefit, base.h is free of function prototypes and includes only
> macro definitions (which can probably be internal, who cares about stuff
> like CG_VALUE_MAX) and definiton of struct cgroup.

Based on IRC conversation, here is list of macros, that current 
libcgroup.h exports:

/* Maximum number of mount points/controllers */
#define MAX_MNT_ELEMENTS        8
/* Estimated number of groups created */
#define MAX_GROUP_ELEMENTS      128

max. number of parameters inside controller?
#define CG_NV_MAX 100

max. nr. of controllers
#define CG_CONTROLLER_MAX 100

max. length of value
#define CG_VALUE_MAX 100

/* Max number of mounted hierarchies. */
#define CG_HIER_MAX  CG_CONTROLLER_MAX

#define ECGRULESPARSEFAIL       ECGROUPPARSEFAIL

IMHO all of them except ECGRULESPARSEFAIL are internal only and can move 
to libcgroup-internal.h. What do you think? Should applications know 
these limits? Our tools like cgset use them quite often to simplify 
things...

ECGRULESPARSEFAIL looks to me like renaming to void ABI breakage, let's 
keep it public.

> Following still applies:
>> Feel free to suggest better groups and/or names.
>
> Jan
>
> ------------------------------------------------------------------------------
> Download Intel® Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling, find bugs
> proactively, and fine-tune applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev
> _______________________________________________
> Libcg-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/libcg-devel


------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Libcg-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libcg-devel

Reply via email to