| /linux/tools/testing/selftests/cgroup/ |
| A D | test_freezer.c | 143 if (!cgroup) in test_cgfreezer_simple() 167 if (cgroup) in test_cgfreezer_simple() 198 cgroup[1] = cg_name(cgroup[0], "B"); in test_cgfreezer_tree() 202 cgroup[2] = cg_name(cgroup[1], "C"); in test_cgfreezer_tree() 206 cgroup[3] = cg_name(cgroup[1], "D"); in test_cgfreezer_tree() 210 cgroup[4] = cg_name(cgroup[0], "E"); in test_cgfreezer_tree() 214 cgroup[5] = cg_name(cgroup[4], "F"); in test_cgfreezer_tree() 218 cgroup[6] = cg_name(cgroup[5], "G"); in test_cgfreezer_tree() 222 cgroup[7] = cg_name(cgroup[6], "H"); in test_cgfreezer_tree() 226 cgroup[8] = cg_name(cgroup[0], "I"); in test_cgfreezer_tree() [all …]
|
| A D | test_kill.c | 64 if (!cgroup) in test_cgkill_simple() 92 if (cgroup) in test_cgkill_simple() 124 cgroup[1] = cg_name(cgroup[0], "B"); in test_cgkill_tree() 128 cgroup[2] = cg_name(cgroup[1], "C"); in test_cgkill_tree() 132 cgroup[3] = cg_name(cgroup[1], "D"); in test_cgkill_tree() 136 cgroup[4] = cg_name(cgroup[0], "E"); in test_cgkill_tree() 140 cgroup[5] = cg_name(cgroup[4], "F"); in test_cgkill_tree() 144 cgroup[6] = cg_name(cgroup[5], "G"); in test_cgkill_tree() 148 cgroup[7] = cg_name(cgroup[6], "H"); in test_cgkill_tree() 152 cgroup[8] = cg_name(cgroup[0], "I"); in test_cgkill_tree() [all …]
|
| A D | cgroup_util.h | 28 extern int cg_create(const char *cgroup); 29 extern int cg_destroy(const char *cgroup); 43 extern int cg_run(const char *cgroup, 44 int (*fn)(const char *cgroup, void *arg), 46 extern int cg_enter(const char *cgroup, int pid); 47 extern int cg_enter_current(const char *cgroup); 49 extern int cg_run_nowait(const char *cgroup, 50 int (*fn)(const char *cgroup, void *arg), 54 extern int alloc_anon(const char *cgroup, void *arg); 58 extern int cg_killall(const char *cgroup); [all …]
|
| A D | cgroup_util.c | 251 int cg_create(const char *cgroup) in cg_create() argument 253 return mkdir(cgroup, 0755); in cg_create() 281 int cg_killall(const char *cgroup) in cg_killall() argument 313 if (!cgroup) in cg_destroy() 316 ret = rmdir(cgroup); in cg_destroy() 318 cg_killall(cgroup); in cg_destroy() 347 int cg_run(const char *cgroup, in cg_run() argument 362 exit(fn(cgroup, arg)); in cg_run() 380 .cgroup = cgroup_fd, in clone_into_cgroup() 459 exit(fn(cgroup, arg)); in clone_into_cgroup_run_nowait() [all …]
|
| /linux/kernel/bpf/ |
| A D | bpf_cgrp_storage.c | 46 void bpf_cgrp_storage_free(struct cgroup *cgroup) in bpf_cgrp_storage_free() argument 81 struct cgroup *cgroup; in bpf_cgrp_storage_lookup_elem() local 86 if (IS_ERR(cgroup)) in bpf_cgrp_storage_lookup_elem() 92 cgroup_put(cgroup); in bpf_cgrp_storage_lookup_elem() 100 struct cgroup *cgroup; in bpf_cgrp_storage_update_elem() local 105 if (IS_ERR(cgroup)) in bpf_cgrp_storage_update_elem() 112 cgroup_put(cgroup); in bpf_cgrp_storage_update_elem() 130 struct cgroup *cgroup; in bpf_cgrp_storage_delete_elem() local 135 if (IS_ERR(cgroup)) in bpf_cgrp_storage_delete_elem() 170 if (!cgroup) in BPF_CALL_5() [all …]
|
| A D | cgroup_iter.c | 47 __bpf_md_ptr(struct cgroup *, cgroup); 134 ctx.cgroup = css ? css->cgroup : NULL; in __cgroup_iter_seq_show() 165 struct cgroup *cgrp = aux->cgroup.start; in BTF_ID_LIST_GLOBAL_SINGLE() 176 p->order = aux->cgroup.order; in BTF_ID_LIST_GLOBAL_SINGLE() 201 struct cgroup *cgrp; in bpf_iter_attach_cgroup() 222 aux->cgroup.start = cgrp; in bpf_iter_attach_cgroup() 223 aux->cgroup.order = order; in bpf_iter_attach_cgroup() 229 cgroup_put(aux->cgroup.start); in bpf_iter_detach_cgroup() 267 info->iter.cgroup.order = aux->cgroup.order; in bpf_iter_cgroup_fill_link_info() 268 info->iter.cgroup.cgroup_id = cgroup_id(aux->cgroup.start); in bpf_iter_cgroup_fill_link_info() [all …]
|
| /linux/tools/testing/selftests/bpf/progs/ |
| A D | cgrp_kfunc_failure.c | 35 struct cgroup *acquired; in BPF_PROG() 54 struct cgroup *acquired; in BPF_PROG() 70 struct cgroup *acquired, *stack_cgrp = (struct cgroup *)&path; in BPF_PROG() 84 struct cgroup *acquired; in BPF_PROG() 98 struct cgroup *acquired; in BPF_PROG() 112 struct cgroup *acquired; in BPF_PROG() 126 struct cgroup *acquired; in BPF_PROG() 140 struct cgroup *kptr; in BPF_PROG() 160 struct cgroup *kptr; in BPF_PROG() 197 struct cgroup *acquired = (struct cgroup *)&path; in BPF_PROG() [all …]
|
| A D | cgrp_kfunc_common.h | 13 struct cgroup __kptr * cgrp; 23 struct cgroup *bpf_cgroup_acquire(struct cgroup *p) __ksym; 24 void bpf_cgroup_release(struct cgroup *p) __ksym; 25 struct cgroup *bpf_cgroup_ancestor(struct cgroup *cgrp, int level) __ksym; 26 struct cgroup *bpf_cgroup_from_id(u64 cgid) __ksym; 30 static inline struct __cgrps_kfunc_map_value *cgrps_kfunc_map_value_lookup(struct cgroup *cgrp) in cgrps_kfunc_map_value_lookup() 42 static inline int cgrps_kfunc_map_insert(struct cgroup *cgrp) in cgrps_kfunc_map_insert() 46 struct cgroup *acquired, *old; in cgrps_kfunc_map_insert()
|
| A D | cgrp_kfunc_success.c | 33 int BPF_PROG(test_cgrp_acquire_release_argument, struct cgroup *cgrp, const char *path) in BPF_PROG() 35 struct cgroup *acquired; in BPF_PROG() 50 int BPF_PROG(test_cgrp_acquire_leave_in_map, struct cgroup *cgrp, const char *path) in BPF_PROG() 65 int BPF_PROG(test_cgrp_xchg_release, struct cgroup *cgrp, const char *path) in BPF_PROG() 67 struct cgroup *kptr, *cg; in BPF_PROG() 108 int BPF_PROG(test_cgrp_get_release, struct cgroup *cgrp, const char *path) in BPF_PROG() 110 struct cgroup *kptr; in BPF_PROG() 139 int BPF_PROG(test_cgrp_get_ancestors, struct cgroup *cgrp, const char *path) in BPF_PROG() 141 struct cgroup *self, *ancestor1, *invalid; in BPF_PROG() 184 int BPF_PROG(test_cgrp_from_id, struct cgroup *cgrp, const char *path) in BPF_PROG() [all …]
|
| /linux/include/linux/ |
| A D | cgroup.h | 100 struct cgroup_subsys_state *cgroup_e_css(struct cgroup *cgroup, 102 struct cgroup_subsys_state *cgroup_get_e_css(struct cgroup *cgroup, 112 int cgroup_transfer_tasks(struct cgroup *to, struct cgroup *from); 493 static inline struct cgroup *cgroup_parent(struct cgroup *cgrp) in cgroup_parent() 530 static inline struct cgroup *cgroup_ancestor(struct cgroup *cgrp, in cgroup_ancestor() 638 struct cgroup; 666 static inline struct cgroup *cgroup_parent(struct cgroup *cgrp) in cgroup_parent() 714 struct cgroup *cgrp; in cgroup_account_cputime() 727 struct cgroup *cgrp; in cgroup_account_cputime_field() 758 return skcd->cgroup; in sock_cgroup_ptr() [all …]
|
| /linux/tools/perf/util/ |
| A D | cgroup.h | 12 struct cgroup { struct 23 struct cgroup *cgroup__get(struct cgroup *cgroup); argument 24 void cgroup__put(struct cgroup *cgroup); 29 struct cgroup *cgroup__new(const char *name, bool do_open); 30 struct cgroup *evlist__findnew_cgroup(struct evlist *evlist, const char *name); 34 void evlist__set_default_cgroup(struct evlist *evlist, struct cgroup *cgroup); 38 struct cgroup *cgroup__findnew(struct perf_env *env, uint64_t id, 40 struct cgroup *cgroup__find(struct perf_env *env, uint64_t id); 41 struct cgroup *__cgroup__find(struct rb_root *root, uint64_t id); 46 int read_cgroup_id(struct cgroup *cgrp); [all …]
|
| A D | cgroup.c | 119 struct cgroup *cgroup = zalloc(sizeof(*cgroup)); in cgroup__new() local 125 if (!cgroup->name) in cgroup__new() 133 cgroup->fd = -1; in cgroup__new() 137 return cgroup; in cgroup__new() 142 free(cgroup); in cgroup__new() 148 struct cgroup *cgroup = evlist__find_cgroup(evlist, name); in evlist__findnew_cgroup() local 179 static void cgroup__delete(struct cgroup *cgroup) in cgroup__delete() argument 182 close(cgroup->fd); in cgroup__delete() 184 free(cgroup); in cgroup__delete() 194 struct cgroup *cgroup__get(struct cgroup *cgroup) in cgroup__get() argument [all …]
|
| /linux/include/trace/events/ |
| A D | cgroup.h | 3 #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, 99 DEFINE_EVENT(cgroup, cgroup_rename, 106 DEFINE_EVENT(cgroup, cgroup_freeze, [all …]
|
| /linux/tools/bpf/bpftool/Documentation/ |
| A D | bpftool-cgroup.rst | 4 bpftool-cgroup 17 **bpftool** [*OPTIONS*] **cgroup** *COMMAND* 31 | **bpftool** **cgroup help** 62 bpftool cgroup tree [*CGROUP_ROOT*] [effective] 79 bpf program, the program in this cgroup yields to sub-cgroup program; 80 **multi** if a sub-cgroup installs some bpf program, that cgroup program 141 | **# mkdir /sys/fs/cgroup/test.slice** 143 | **# bpftool cgroup attach /sys/fs/cgroup/test.slice/ device id 1 allow_multi** 145 **# bpftool cgroup list /sys/fs/cgroup/test.slice/** 153 | **# bpftool cgroup detach /sys/fs/cgroup/test.slice/ device id 1** [all …]
|
| /linux/Documentation/admin-guide/cgroup-v1/ |
| A D | cgroups.rst | 220 cgroup hierarchy, or to unbind a subsystem from an active cgroup 252 cgroup dir. 293 some other cgroup) and the last child cgroup of that cgroup 308 flag is enabled (1) in a cgroup, a new cpuset cgroup will copy its 319 3) mount -t cgroup -ocpuset cpuset /sys/fs/cgroup/cpuset 324 /sys/fs/cgroup/cpuset tasks file for that cgroup. 333 mount -t cgroup cpuset -ocpuset /sys/fs/cgroup/cpuset 356 # mount -t cgroup xxx /sys/fs/cgroup 377 # mount -t cgroup -o cpuset,memory hier1 /sys/fs/cgroup/rg1 408 If you want to create a new cgroup under /sys/fs/cgroup/rg1:: [all …]
|
| A D | pids.rst | 14 the number of tasks in a cgroup. 47 # mkdir -p /sys/fs/cgroup/pids 48 # mount -t cgroup -o pids none /sys/fs/cgroup/pids 52 # mkdir -p /sys/fs/cgroup/pids/parent/child 53 # echo 2 > /sys/fs/cgroup/pids/parent/pids.max 54 # echo $$ > /sys/fs/cgroup/pids/parent/cgroup.procs 55 # cat /sys/fs/cgroup/pids/parent/pids.current 62 # cat /sys/fs/cgroup/pids/parent/pids.current 72 # echo $$ > /sys/fs/cgroup/pids/parent/child/cgroup.procs 73 # cat /sys/fs/cgroup/pids/parent/pids.current [all …]
|
| A D | freezer-subsystem.rst | 5 The cgroup freezer is useful to batch job management system which start 56 The cgroup freezer is hierarchical. Freezing a cgroup freezes all 85 the cgroup also leave the freezing state. 102 # mkdir /sys/fs/cgroup/freezer 103 # mount -t cgroup -ofreezer freezer /sys/fs/cgroup/freezer 104 # mkdir /sys/fs/cgroup/freezer/0 105 # echo $some_pid > /sys/fs/cgroup/freezer/0/tasks 109 # cat /sys/fs/cgroup/freezer/0/freezer.state 115 # cat /sys/fs/cgroup/freezer/0/freezer.state 117 # cat /sys/fs/cgroup/freezer/0/freezer.state [all …]
|
| A D | rdma.rst | 23 cgroup. 40 RDMA cgroup allows limit configuration of resources. Rdma cgroup maintains 41 resource accounting per cgroup, per device using resource pool structure. 43 by rdma cgroup, which can be extended later if required. 45 This resource pool object is linked to the cgroup css. Typically there 48 single cgroup may not be handled optimally, however there is no 64 a process from previously charged cgroup which is migrated to new cgroup, 69 of interest for the cgroup. 99 echo ocrdma1 hca_handle=3 > /sys/fs/cgroup/rdma/2/rdma.max 103 cat /sys/fs/cgroup/rdma/2/rdma.max [all …]
|
| A D | net_cls.rst | 2 Network classifier cgroup 5 The Network classifier cgroup provides an interface to 23 mkdir /sys/fs/cgroup/net_cls 24 mount -t cgroup -onet_cls net_cls /sys/fs/cgroup/net_cls 25 mkdir /sys/fs/cgroup/net_cls/0 26 echo 0x100001 > /sys/fs/cgroup/net_cls/0/net_cls.classid 30 cat /sys/fs/cgroup/net_cls/0/net_cls.classid 40 tc filter add dev eth0 parent 10: protocol ip prio 10 handle 1: cgroup 44 iptables -A OUTPUT -m cgroup ! --cgroup 0x100001 -j DROP
|
| /linux/Documentation/bpf/libbpf/ |
| A D | program_types.rst | 24 | ``BPF_PROG_TYPE_CGROUP_DEVICE`` | ``BPF_CGROUP_DEVICE`` | ``cgroup/dev… 26 | ``BPF_PROG_TYPE_CGROUP_SKB`` | | ``cgroup/skb… 32 | ``BPF_PROG_TYPE_CGROUP_SOCKOPT`` | ``BPF_CGROUP_GETSOCKOPT`` | ``cgroup/get… 34 | | ``BPF_CGROUP_SETSOCKOPT`` | ``cgroup/set… 36 | ``BPF_PROG_TYPE_CGROUP_SOCK_ADDR`` | ``BPF_CGROUP_INET4_BIND`` | ``cgroup/bin… 38 | | ``BPF_CGROUP_INET4_CONNECT`` | ``cgroup/con… 40 | | ``BPF_CGROUP_INET4_GETPEERNAME`` | ``cgroup/get… 42 | | ``BPF_CGROUP_INET4_GETSOCKNAME`` | ``cgroup/get… 44 | | ``BPF_CGROUP_INET6_BIND`` | ``cgroup/bin… 46 | | ``BPF_CGROUP_INET6_CONNECT`` | ``cgroup/con… [all …]
|
| /linux/kernel/cgroup/ |
| A D | rstat.c | 106 struct cgroup *parent = cgroup_parent(cgrp); in cgroup_rstat_updated() 144 static struct cgroup *cgroup_rstat_push_children(struct cgroup *head, in cgroup_rstat_push_children() 145 struct cgroup *child, int cpu) in cgroup_rstat_push_children() 149 struct cgroup *parent, *grandchild; in cgroup_rstat_push_children() 203 static struct cgroup *cgroup_rstat_updated_list(struct cgroup *root, int cpu) in cgroup_rstat_updated_list() 207 struct cgroup *head = NULL, *parent, *child; in cgroup_rstat_updated_list() 223 struct cgroup **nextp; in cgroup_rstat_updated_list() 267 struct cgroup *parent, int cpu) in bpf_rstat_flush() 385 int cgroup_rstat_init(struct cgroup *cgrp) in cgroup_rstat_init() 407 void cgroup_rstat_exit(struct cgroup *cgrp) in cgroup_rstat_exit() [all …]
|
| A D | cgroup-internal.h | 98 struct cgroup *cgrp; 186 static inline bool cgroup_is_dead(const struct cgroup *cgrp) in cgroup_is_dead() 224 bool cgroup_on_dfl(const struct cgroup *cgrp); 241 int cgroup_migrate_vet_dst(struct cgroup *dst_cgrp); 259 void cgroup_lock_and_drain_offline(struct cgroup *cgrp); 266 int __cgroup_task_count(const struct cgroup *cgrp); 267 int cgroup_task_count(const struct cgroup *cgrp); 272 int cgroup_rstat_init(struct cgroup *cgrp); 273 void cgroup_rstat_exit(struct cgroup *cgrp); 291 void cgroup1_pidlist_destroy_all(struct cgroup *cgrp); [all …]
|
| A D | cgroup.c | 1697 struct cgroup *cgrp = css->cgroup; in css_clear_dir() 1730 struct cgroup *cgrp = css->cgroup; in css_populate_dir() 3202 struct cgroup *cgrp = css->cgroup; in css_visible() 3678 struct cgroup *cgroup = seq_css(seq)->cgroup; in cgroup_stat_show() local 4331 struct cgroup *cgrp = css->cgroup; in cgroup_apply_cftypes() 5405 struct cgroup *cgrp = css->cgroup; in css_free_rwork_fn() 5456 struct cgroup *cgrp = css->cgroup; in css_release_work_fn() 5790 struct cgroup *cgroup; in cgroup_check_hierarchy_limits() local 5796 for (cgroup = parent; cgroup; cgroup = cgroup_parent(cgroup)) { in cgroup_check_hierarchy_limits() 7049 struct cgroup *cgroup; in cgroup_sk_alloc() local [all …]
|
| /linux/Documentation/admin-guide/ |
| A D | cgroup-v2.rst | 106 What is cgroup? 295 0::/test-cgroup/test-cgroup-nested 302 0::/test-cgroup/test-cgroup-nested (deleted) 541 "cgroup.procs", "cgroup.threads", "cgroup.subtree_control", etc.). 845 All cgroup core files are prefixed with "cgroup." 988 cgroup) at and beneath the current cgroup. 992 cgroup) at and beneath the current cgroup. 1866 cgroup. 1921 cgroup. 2862 cgroup paths (in /proc/self/cgroup) only inside their root cgroup. [all …]
|
| /linux/tools/perf/tests/shell/ |
| A D | stat_bpf_counters_cgrp.sh | 15 if ! perf stat -a --bpf-counters --for-each-cgroup / true > /dev/null 2>&1; then 18 perf --no-pager stat -a --bpf-counters --for-each-cgroup / true || true 28 if [ -d /sys/fs/cgroup/system.slice ] && [ -d /sys/fs/cgroup/user.slice ]; then 34 find_cgroups_self_cgrp=$(grep perf_event /proc/self/cgroup | cut -d: -f3) 37 find_cgroups_self_cgrp=$(grep ^0: /proc/self/cgroup | cut -d: -f3) 51 …check_system_wide_counted_output=$(perf stat -a --bpf-counters --for-each-cgroup ${test_cgroups} -… 63 …check_cpu_list_counted_output=$(perf stat -C 0,1 --bpf-counters --for-each-cgroup ${test_cgroups} …
|