On Thu, Jul 29, 2010 at 12:08 PM, Balbir Singh <[email protected]> wrote: > * Nikunj A. Dadhania <[email protected]> [2010-07-29 11:24:05]: > >> On Tue, 27 Jul 2010 10:18:43 +0200, Dhaval Giani <[email protected]> >> wrote: >> > On Tue, Jul 27, 2010 at 7:05 AM, Nikunj A. Dadhania >> > <[email protected]> wrote: >> > > On Mon, 26 Jul 2010 10:48:59 +0200, Dhaval Giani >> > > <[email protected]> wrote: >> > >> Signed-off-by: Dhaval Giani <[email protected]> >> > > >> > >> +struct cgroup_context_s { >> > >> + char *cg_namespace[CG_CONTROLLER_MAX]; >> > >> + struct cg_mount_table_s mount[CG_CONTROLLER_MAX]; >> > >> + unsigned size; >> > >> +}; >> > > CG_CONTROLLER_MAX is set at 100, can we do something like this? >> > > >> > > enum { >> > > CG_CPU, >> > > CG_MEMORY, >> > > CG_IO, >> > > CG_CPUSET, >> > > /* all controllers go here */ >> > > >> > > /* Last in the enum list */ >> > > CG_CONTROLLER_MAX >> > > }; >> > > >> > > This will make sure that we do not do excessive allocations, as this >> > > struct is >> > > going to be allocated per thread. >> > > >> > >> > I am bit worried about ABI breakage as we add more controllers, and >> > then we start getting into this problem that older versions of >> > libcgroup cannot be used with newer controllers and the likes (sure, >> > we would like them to use the newer version, but sometimes... ). >> > Similarly libcgroup will have to be modified to be used with a >> > development kernel. Not to mention that we have named hierarchies >> > which might not have any controllers attached to them. (systemd makes >> > use of them) >> >> sizeof(struct cgroup_context_s) returns 820408 bytes. Is this really >> intended? >> > > wow! that is huge, can you please break that down? >
I will dynamically allocate as much as needed. But for now, while this patchset is under development, I would rather that stuff work. While it is big, it is not necessary to fix it up right now. Sure, before we merge it in, it needs to be fixed up, but I would worry about it later on. (BTW, all the big structures can be fixed up by dynamically allocating stuff, but as i said, it is a bit lower priority for me to getting the patches and teh changes to work). Dhaval ------------------------------------------------------------------------------ The Palm PDK Hot Apps Program offers developers who use the Plug-In Development Kit to bring their C/C++ apps to Palm for a share of $1 Million in cash or HP Products. Visit us here for more details: http://p.sf.net/sfu/dev2dev-palm _______________________________________________ Libcg-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/libcg-devel
