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.

> +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,
> +};
> 


-- 
        Warm Regards,
        Balbir Singh
        Linux Technology Center
        IBM, ISTL

_______________________________________________
Devel mailing list
[email protected]
https://openvz.org/mailman/listinfo/devel

Reply via email to