[Devel] Re: [PATCH v5 3/3] cgroups: make procs file writable

David Rientjes rientjes at google.com
Fri Dec 24 13:32:28 PST 2010


On Fri, 24 Dec 2010, Ben Blum wrote:

> Good point. How about pre-allocating the nodemasks in cpuset_can_attach,
> and having a cpuset_cancel_attach function which can free them up?
> 
> They could be stored in the struct cpuset (protected by cgroup_mutex)
> after being pre-allocated - but also only if a heap-allocation was
> required, so there might need to be an extra interface, like
> "NODEMASK_PREALLOC" (a no-op if heap not required, otherwise allocates
> and stores in the struct cpuset) and "NODEMASK_RETRIEVE"?
> 

I don't think it should be limited to only cpusets since what's being 
described is a characteristic of cgroups and others may need to allocate 
nodemasks in attach functions either presently or in the future as well.

If you're protecting the attach function with cgroup_mutex (or can protect 
it with a lock), then you should be able to statically allocate the 
nodemasks.  Such an implementation could complement NODEMASK_ALLOC() but 
be done statically regardless of CONFIG_NODES_SHIFT.
_______________________________________________
Containers mailing list
Containers at lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers




More information about the Devel mailing list