2014-05-08 16:37:00 +04:00
|
|
|
#ifndef __CR_CGROUP_H__
|
|
|
|
#define __CR_CGROUP_H__
|
|
|
|
#include "asm/int.h"
|
2014-05-08 16:42:40 +04:00
|
|
|
struct pstree_item;
|
2014-05-08 16:55:53 +04:00
|
|
|
extern u32 root_cg_set;
|
2014-05-08 16:42:40 +04:00
|
|
|
int dump_task_cgroup(struct pstree_item *, u32 *);
|
|
|
|
int dump_cgroups(void);
|
2014-05-08 16:55:53 +04:00
|
|
|
int prepare_task_cgroup(struct pstree_item *);
|
|
|
|
int prepare_cgroup(void);
|
2014-08-07 15:26:13 -07:00
|
|
|
/* Restore things like cpu_limit in known cgroups. */
|
|
|
|
int prepare_cgroup_properties(void);
|
2014-05-08 16:55:53 +04:00
|
|
|
void fini_cgroup(void);
|
2014-07-10 17:00:28 +04:00
|
|
|
|
|
|
|
struct cg_controller;
|
|
|
|
|
2014-08-07 15:26:13 -07:00
|
|
|
struct cgroup_prop {
|
|
|
|
char *name;
|
|
|
|
char *value;
|
|
|
|
struct list_head list;
|
|
|
|
};
|
|
|
|
|
2014-07-10 17:00:28 +04:00
|
|
|
/* This describes a particular cgroup path, e.g. the '/lxc/u1' part of
|
|
|
|
* 'blkio/lxc/u1' and any properties it has.
|
|
|
|
*/
|
|
|
|
struct cgroup_dir {
|
|
|
|
char *path;
|
|
|
|
|
2014-08-07 15:26:13 -07:00
|
|
|
struct list_head properties;
|
|
|
|
unsigned int n_properties;
|
|
|
|
|
2014-07-10 17:00:28 +04:00
|
|
|
/* this is how children are linked together */
|
|
|
|
struct list_head siblings;
|
|
|
|
|
|
|
|
/* more cgroup_dirs */
|
|
|
|
struct list_head children;
|
|
|
|
unsigned int n_children;
|
|
|
|
};
|
|
|
|
|
|
|
|
/* This describes a particular cgroup controller, e.g. blkio or cpuset.
|
|
|
|
* The heads are subdirectories organized in their tree format.
|
|
|
|
*/
|
|
|
|
struct cg_controller {
|
|
|
|
int heirarchy;
|
|
|
|
unsigned int n_controllers;
|
|
|
|
char **controllers;
|
|
|
|
|
|
|
|
/* cgroup_dirs */
|
|
|
|
struct list_head heads;
|
|
|
|
unsigned int n_heads;
|
|
|
|
|
|
|
|
/* for cgroup list in cgroup.c */
|
|
|
|
struct list_head l;
|
|
|
|
};
|
|
|
|
struct cg_controller *new_controller(const char *name, int heirarchy);
|
|
|
|
|
|
|
|
/* parse all global cgroup information into structures */
|
|
|
|
int parse_cg_info(void);
|
2014-08-15 17:02:21 -05:00
|
|
|
int new_cg_root_add(char *controller, char *newroot);
|
2014-05-08 16:37:00 +04:00
|
|
|
#endif /* __CR_CGROUP_H__ */
|