Home
last modified time | relevance | path

Searched refs:cgroup (Results 1 – 25 of 108) sorted by relevance

12345

/Linux-v4.19/tools/perf/util/
Dcgroup.c93 static struct cgroup *evlist__find_cgroup(struct perf_evlist *evlist, const char *str) in evlist__find_cgroup()
109 static struct cgroup *cgroup__new(const char *name) in cgroup__new()
111 struct cgroup *cgroup = zalloc(sizeof(*cgroup)); in cgroup__new() local
113 if (cgroup != NULL) { in cgroup__new()
114 refcount_set(&cgroup->refcnt, 1); in cgroup__new()
116 cgroup->name = strdup(name); in cgroup__new()
117 if (!cgroup->name) in cgroup__new()
119 cgroup->fd = open_cgroup(name); in cgroup__new()
120 if (cgroup->fd == -1) in cgroup__new()
124 return cgroup; in cgroup__new()
[all …]
Dcgroup.h9 struct cgroup { struct
18 struct cgroup *cgroup__get(struct cgroup *cgroup); argument
19 void cgroup__put(struct cgroup *cgroup);
23 struct cgroup *evlist__findnew_cgroup(struct perf_evlist *evlist, const char *name);
25 void evlist__set_default_cgroup(struct perf_evlist *evlist, struct cgroup *cgroup);
/Linux-v4.19/tools/testing/selftests/cgroup/
Dcgroup_util.h21 extern int cg_create(const char *cgroup);
22 extern int cg_destroy(const char *cgroup);
23 extern int cg_read(const char *cgroup, const char *control,
25 extern int cg_read_strcmp(const char *cgroup, const char *control,
27 extern int cg_read_strstr(const char *cgroup, const char *control,
29 extern long cg_read_long(const char *cgroup, const char *control);
30 long cg_read_key_long(const char *cgroup, const char *control, const char *key);
31 extern int cg_write(const char *cgroup, const char *control, char *buf);
32 extern int cg_run(const char *cgroup,
33 int (*fn)(const char *cgroup, void *arg),
[all …]
Dcgroup_util.c77 int cg_read(const char *cgroup, const char *control, char *buf, size_t len) in cg_read() argument
81 snprintf(path, sizeof(path), "%s/%s", cgroup, control); in cg_read()
89 int cg_read_strcmp(const char *cgroup, const char *control, in cg_read_strcmp() argument
106 if (cg_read(cgroup, control, buf, size)) { in cg_read_strcmp()
116 int cg_read_strstr(const char *cgroup, const char *control, const char *needle) in cg_read_strstr() argument
120 if (cg_read(cgroup, control, buf, sizeof(buf))) in cg_read_strstr()
126 long cg_read_long(const char *cgroup, const char *control) in cg_read_long() argument
130 if (cg_read(cgroup, control, buf, sizeof(buf))) in cg_read_long()
136 long cg_read_key_long(const char *cgroup, const char *control, const char *key) in cg_read_key_long() argument
141 if (cg_read(cgroup, control, buf, sizeof(buf))) in cg_read_key_long()
[all …]
/Linux-v4.19/tools/bpf/bpftool/Documentation/
Dbpftool-cgroup.rst2 bpftool-cgroup
13 **bpftool** [*OPTIONS*] **cgroup** *COMMAND*
23 | **bpftool** **cgroup { show | list }** *CGROUP*
24 | **bpftool** **cgroup tree** [*CGROUP_ROOT*]
25 | **bpftool** **cgroup attach** *CGROUP* *ATTACH_TYPE* *PROG* [*ATTACH_FLAGS*]
26 | **bpftool** **cgroup detach** *CGROUP* *ATTACH_TYPE* *PROG*
27 | **bpftool** **cgroup help**
37 **bpftool cgroup { show | list }** *CGROUP*
38 List all programs attached to the cgroup *CGROUP*.
43 **bpftool cgroup tree** [*CGROUP_ROOT*]
[all …]
/Linux-v4.19/include/linux/
Dcgroup.h96 struct cgroup_subsys_state *cgroup_get_e_css(struct cgroup *cgroup,
101 struct cgroup *cgroup_get_from_path(const char *path);
102 struct cgroup *cgroup_get_from_fd(int fd);
105 int cgroup_transfer_tasks(struct cgroup *to, struct cgroup *from);
403 static inline void cgroup_get(struct cgroup *cgrp) in cgroup_get()
408 static inline bool cgroup_tryget(struct cgroup *cgrp) in cgroup_tryget()
413 static inline void cgroup_put(struct cgroup *cgrp) in cgroup_put()
519 static inline struct cgroup *task_cgroup(struct task_struct *task, in task_cgroup()
522 return task_css(task, subsys_id)->cgroup; in task_cgroup()
525 static inline struct cgroup *task_dfl_cgroup(struct task_struct *task) in task_dfl_cgroup()
[all …]
Dbpf-cgroup.h13 struct cgroup;
67 void cgroup_bpf_put(struct cgroup *cgrp);
68 int cgroup_bpf_inherit(struct cgroup *cgrp);
70 int __cgroup_bpf_attach(struct cgroup *cgrp, struct bpf_prog *prog,
72 int __cgroup_bpf_detach(struct cgroup *cgrp, struct bpf_prog *prog,
74 int __cgroup_bpf_query(struct cgroup *cgrp, const union bpf_attr *attr,
78 int cgroup_bpf_attach(struct cgroup *cgrp, struct bpf_prog *prog,
80 int cgroup_bpf_detach(struct cgroup *cgrp, struct bpf_prog *prog,
82 int cgroup_bpf_query(struct cgroup *cgrp, const union bpf_attr *attr,
118 struct cgroup *cgroup,
[all …]
/Linux-v4.19/Documentation/cgroup-v1/
Dcgroups.txt5 Documentation/cgroup-v1/cpusets.txt
46 A *cgroup* associates a set of tasks with a set of parameters for one
52 schedules a resource or applies per-cgroup limits, but it may be
59 state attached to each cgroup in the hierarchy. Each hierarchy has
60 an instance of the cgroup virtual filesystem associated with it.
66 instance of the cgroup virtual file system, specify and query to
67 which cgroup a task is assigned, and list the task PIDs assigned to
68 a cgroup. Those creations and assignments only affect the hierarchy
69 associated with that instance of the cgroup file system.
73 cgroup support to provide new attributes for cgroups, such as
[all …]
Dpids.txt7 The process number controller is used to allow a cgroup hierarchy to stop any
12 preventable in the scope of a cgroup hierarchy by allowing resource limiting of
13 the number of tasks in a cgroup.
19 pids.max (this is not available in the root cgroup for obvious reasons). The
20 number of processes currently in the cgroup is given by pids.current.
22 Organisational operations are not blocked by cgroup policies, so it is possible
24 be smaller than pids.current, or attaching enough processes to the cgroup such
25 that pids.current > pids.max. However, it is not possible to violate a cgroup
27 creation of a new process would cause a cgroup policy to be violated.
29 To set a cgroup to have no limit, set pids.max to "max". This is the default for
[all …]
Dfreezer-subsystem.txt1 The cgroup freezer is useful to batch job management system which start
5 whole. The cgroup freezer uses cgroups to describe the set of tasks to
9 The cgroup freezer will also be useful for checkpointing running groups
11 image of the tasks by attempting to force the tasks in a cgroup into a
47 In contrast, the cgroup freezer uses the kernel freezer code to
52 The cgroup freezer is hierarchical. Freezing a cgroup freezes all
53 tasks belonging to the cgroup and all its descendant cgroups. Each
54 cgroup has its own state (self-state) and the state inherited from the
55 parent (parent-state). Iff both states are THAWED, the cgroup is
58 The following cgroupfs files are created by cgroup freezer.
[all …]
Drdma.txt22 cgroup.
29 in other cgroup or kernel space ULPs may not even get chance to allocate any
39 RDMA cgroup allows limit configuration of resources. Rdma cgroup maintains
40 resource accounting per cgroup, per device using resource pool structure.
42 by rdma cgroup, which can be extended later if required.
44 This resource pool object is linked to the cgroup css. Typically there
45 are 0 to 4 resource pool instances per cgroup, per device in most use cases.
47 single cgroup may not be handled optimally, however there is no
52 always owned by the creator cgroup css. This allows process migration from one
53 to other cgroup without major complexity of transferring resource ownership;
[all …]
Dnet_cls.txt1 Network classifier cgroup
4 The Network classifier cgroup provides an interface to
21 mkdir /sys/fs/cgroup/net_cls
22 mount -t cgroup -onet_cls net_cls /sys/fs/cgroup/net_cls
23 mkdir /sys/fs/cgroup/net_cls/0
24 echo 0x100001 > /sys/fs/cgroup/net_cls/0/net_cls.classid
27 cat /sys/fs/cgroup/net_cls/0/net_cls.classid
36 tc filter add dev eth0 parent 10: protocol ip prio 10 handle 1: cgroup
39 iptables -A OUTPUT -m cgroup ! --cgroup 0x100001 -j DROP
Dcpuacct.txt11 Accounting groups can be created by first mounting the cgroup filesystem.
13 # mount -t cgroup -ocpuacct none /sys/fs/cgroup
16 visible at /sys/fs/cgroup. At bootup, this group includes all the tasks in
17 the system. /sys/fs/cgroup/tasks lists the tasks in this cgroup.
18 /sys/fs/cgroup/cpuacct.usage gives the CPU time (in nanoseconds) obtained
22 New accounting groups can be created under the parent group /sys/fs/cgroup.
24 # cd /sys/fs/cgroup
31 /sys/fs/cgroup/cpuacct.usage also.
34 CPU time obtained by the cgroup into user and system times. Currently
37 user: Time spent by tasks of the cgroup in user mode.
[all …]
Dmemcg_test.txt9 (*) Topics on API should be in Documentation/cgroup-v1/memory.txt)
141 mount -t cgroup -o cpuset none /opt/cpuset
182 echo 1 >/opt/cgroup/01/memory/use_hierarchy
183 mkdir /opt/cgroup/01/child_a
184 mkdir /opt/cgroup/01/child_b
191 /opt/cgroup/01/child_a/child_aa
192 /opt/cgroup/01/child_b/child_bb
193 /opt/cgroup/01/child_c
199 race and lock dependency with other cgroup subsystems.
202 # mount -t cgroup none /cgroup -o cpuset,memory,cpu,devices
[all …]
Dnet_prio.txt1 Network priority cgroup
4 The Network priority cgroup provides an interface to allow an administrator to
15 This cgroup allows an administrator to assign a process to a group which defines
17 be created by first mounting the cgroup filesystem.
19 # mount -t cgroup -onet_prio none /sys/fs/cgroup/net_prio
22 becomes visible at '/sys/fs/cgroup/net_prio'. This group includes all tasks in
23 the system. '/sys/fs/cgroup/net_prio/tasks' lists the tasks in this cgroup.
25 Each net_prio cgroup contains two files that are subsystem specific
29 value that the kernel uses as an internal representation of this cgroup.
41 iscsi net_prio cgroup and egressing on interface eth0 to have the priority of
[all …]
Ddevices.txt5 Implement a cgroup to track and enforce open and mknod restrictions
6 on device files. A device cgroup associates a device access
7 whitelist with each cgroup. A whitelist entry has 4 fields.
13 The root device cgroup starts with rwm to 'all'. A child device
14 cgroup gets a copy of the parent. Administrators can then remove
15 devices from the whitelist or add new entries. A child cgroup can
23 echo 'c 1:3 mr' > /sys/fs/cgroup/1/devices.allow
25 allows cgroup 1 to read and mknod the device usually known as
28 echo a > /sys/fs/cgroup/1/devices.deny
32 echo a > /sys/fs/cgroup/1/devices.allow
[all …]
Dblkio-controller.txt5 cgroup subsys "blkio" implements the block io controller. There seems to be
8 Plan is to use the same cgroup based management interface for blkio controller
34 mount -t tmpfs cgroup_root /sys/fs/cgroup
35 mkdir /sys/fs/cgroup/blkio
36 mount -t cgroup -o blkio none /sys/fs/cgroup/blkio
39 mkdir -p /sys/fs/cgroup/blkio/test1/ /sys/fs/cgroup/blkio/test2
42 echo 1000 > /sys/fs/cgroup/blkio/test1/blkio.weight
43 echo 500 > /sys/fs/cgroup/blkio/test2/blkio.weight
46 launch two dd threads in different cgroup to read those files.
52 echo $! > /sys/fs/cgroup/blkio/test1/tasks
[all …]
Dmemory.txt14 When we mention a cgroup (cgroupfs's directory) with memory controller,
15 we call it "memory cgroup". When you see git-log and source code, you'll
28 b. Create a cgroup with a limited amount of memory; this can be used
50 - Root cgroup has no limit controls.
58 cgroup.procs # show list of processes
59 cgroup.event_control # an interface for event_fd()
126 processes associated with the controller. Each cgroup has a memory controller
154 1. Accounting happens per cgroup
155 2. Each mm_struct knows about which cgroup it belongs to
157 cgroup it belongs to
[all …]
/Linux-v4.19/kernel/cgroup/
Dcgroup-internal.h47 struct cgroup *cgrp;
147 static inline bool cgroup_is_dead(const struct cgroup *cgrp) in cgroup_is_dead()
152 static inline bool notify_on_release(const struct cgroup *cgrp) in notify_on_release()
185 bool cgroup_on_dfl(const struct cgroup *cgrp);
186 bool cgroup_is_thread_root(struct cgroup *cgrp);
187 bool cgroup_is_threaded(struct cgroup *cgrp);
190 struct cgroup *task_cgroup_from_root(struct task_struct *task,
192 struct cgroup *cgroup_kn_lock_live(struct kernfs_node *kn, bool drain_offline);
194 int cgroup_path_ns_locked(struct cgroup *cgrp, char *buf, size_t buflen,
205 int cgroup_migrate_vet_dst(struct cgroup *dst_cgrp);
[all …]
Drstat.c8 static void cgroup_base_stat_flush(struct cgroup *cgrp, int cpu);
10 static struct cgroup_rstat_cpu *cgroup_rstat_cpu(struct cgroup *cgrp, int cpu) in cgroup_rstat_cpu()
24 void cgroup_rstat_updated(struct cgroup *cgrp, int cpu) in cgroup_rstat_updated()
27 struct cgroup *parent; in cgroup_rstat_updated()
86 static struct cgroup *cgroup_rstat_cpu_pop_updated(struct cgroup *pos, in cgroup_rstat_cpu_pop_updated()
87 struct cgroup *root, int cpu) in cgroup_rstat_cpu_pop_updated()
90 struct cgroup *parent; in cgroup_rstat_cpu_pop_updated()
122 struct cgroup **nextp; in cgroup_rstat_cpu_pop_updated()
149 static void cgroup_rstat_flush_locked(struct cgroup *cgrp, bool may_sleep) in cgroup_rstat_flush_locked()
159 struct cgroup *pos = NULL; in cgroup_rstat_flush_locked()
[all …]
Dcgroup.c213 static int cgroup_apply_control(struct cgroup *cgrp);
214 static void cgroup_finalize_control(struct cgroup *cgrp, int ret);
216 static int cgroup_destroy_locked(struct cgroup *cgrp);
217 static struct cgroup_subsys_state *css_create(struct cgroup *cgrp,
222 struct cgroup *cgrp, struct cftype cfts[],
294 bool cgroup_on_dfl(const struct cgroup *cgrp) in cgroup_on_dfl()
330 static bool cgroup_has_tasks(struct cgroup *cgrp) in cgroup_has_tasks()
335 bool cgroup_is_threaded(struct cgroup *cgrp) in cgroup_is_threaded()
341 static bool cgroup_is_mixable(struct cgroup *cgrp) in cgroup_is_mixable()
352 static bool cgroup_can_be_thread_root(struct cgroup *cgrp) in cgroup_can_be_thread_root()
[all …]
/Linux-v4.19/Documentation/admin-guide/
Dcgroup-v2.rst9 conventions of cgroup v2. It describes all userland-visible aspects
10 of cgroup including core and specific controller behaviors. All
12 v1 is available under Documentation/cgroup-v1/.
18 1-2. What is cgroup?
65 5-N-1. CPU controller root cgroup process behaviour
66 5-N-2. IO controller root cgroup process behaviour
90 "cgroup" stands for "control group" and is never capitalized. The
92 qualifier as in "cgroup controllers". When explicitly referring to
96 What is cgroup?
99 cgroup is a mechanism to organize processes hierarchically and
[all …]
/Linux-v4.19/include/trace/events/
Dcgroup.h3 #define TRACE_SYSTEM cgroup
54 DECLARE_EVENT_CLASS(cgroup,
56 TP_PROTO(struct cgroup *cgrp, const char *path),
78 DEFINE_EVENT(cgroup, cgroup_mkdir,
80 TP_PROTO(struct cgroup *cgrp, const char *path),
85 DEFINE_EVENT(cgroup, cgroup_rmdir,
87 TP_PROTO(struct cgroup *cgrp, const char *path),
92 DEFINE_EVENT(cgroup, cgroup_release,
94 TP_PROTO(struct cgroup *cgrp, const char *path),
99 DEFINE_EVENT(cgroup, cgroup_rename,
[all …]
/Linux-v4.19/Documentation/accounting/
Dcgroupstats.txt2 http://lkml.org/lkml/2007/4/11/187 and implements per cgroup statistics as
5 Per cgroup statistics infrastructure re-uses code from the taskstats
6 interface. A new set of cgroup operations are registered with commands
8 extend per cgroup statistics, by adding members to the cgroupstats
13 user space requests for statistics by passing the cgroup path.
14 Statistics about the state of all the tasks in the cgroup is returned to
21 To extract cgroup statistics a utility very similar to getdelays.c
24 ~/balbir/cgroupstats # ./getdelays -C "/sys/fs/cgroup/a"
26 ~/balbir/cgroupstats # ./getdelays -C "/sys/fs/cgroup"
/Linux-v4.19/kernel/bpf/
Dcgroup.c26 void cgroup_bpf_put(struct cgroup *cgrp) in cgroup_bpf_put()
66 static bool hierarchy_allows_attach(struct cgroup *cgrp, in hierarchy_allows_attach()
70 struct cgroup *p; in hierarchy_allows_attach()
96 static int compute_effective_progs(struct cgroup *cgrp, in compute_effective_progs()
102 struct cgroup *p = cgrp; in compute_effective_progs()
137 static void activate_effective_progs(struct cgroup *cgrp, in activate_effective_progs()
154 int cgroup_bpf_inherit(struct cgroup *cgrp) in cgroup_bpf_inherit()
180 static int update_effective_progs(struct cgroup *cgrp, in update_effective_progs()
188 struct cgroup *desc = container_of(css, struct cgroup, self); in update_effective_progs()
197 struct cgroup *desc = container_of(css, struct cgroup, self); in update_effective_progs()
[all …]

12345