[Devel] Re: [PATCH 4/5] Setup the control group
Pavel Emelyanov
xemul at openvz.org
Mon Oct 1 06:51:46 PDT 2007
Balbir Singh wrote:
> Pavel Emelyanov wrote:
>> Attach the controller to the control groups. This will work
>> with the SLUB allocator only. However, if we need I can
>> port this on SLAB (and maybe SLOB ;) ).
>>
>> This setup is simple and stupid.
>>
>
> That makes it easier for me to review it:)
:)
>> +static struct cftype kmem_files[] = {
>> + {
>> + .name = "usage",
>> + .private = RES_USAGE,
>> + .read = kmem_container_read,
>> + },
>> + {
>> + .name = "limit",
>> + .private = RES_LIMIT,
>> + .write = kmem_container_write,
>> + .read = kmem_container_read,
>> + },
>> + {
>> + .name = "failcnt",
>> + .private = RES_FAILCNT,
>> + .read = kmem_container_read,
>> + },
>> +};
>> +
>
> Could we make the user interface similar to the one in the memory
> controller please! It would make it easier for users to configure
> and control both.
Do you mean by merging the similar code or by making them look like
the same? If the second, than can you point at least one difference
except for "usage" vs "usage_in_bytes" (and similar) naming?
>> +static int kmem_populate(struct cgroup_subsys *ss, struct cgroup *cnt)
>> +{
>> + return cgroup_add_files(cnt, ss, kmem_files, ARRAY_SIZE(kmem_files));
>> +}
>> +
>> +struct cgroup_subsys kmem_subsys = {
>> + .name = "kmem",
>> + .create = kmem_create,
>> + .destroy = kmem_destroy,
>> + .populate = kmem_populate,
>> + .subsys_id = kmem_subsys_id,
>> + .early_init = 1,
>> +};
>>
>
>
More information about the Devel
mailing list