/openbmc/linux/tools/testing/selftests/cgroup/ |
H 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 …]
|
H 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 …]
|
H A D | cgroup_util.h | 28 extern int cg_create(const char *cgroup); 29 extern int cg_destroy(const char *cgroup); 41 extern int cg_run(const char *cgroup, 42 int (*fn)(const char *cgroup, void *arg), 44 extern int cg_enter(const char *cgroup, int pid); 45 extern int cg_enter_current(const char *cgroup); 47 extern int cg_run_nowait(const char *cgroup, 48 int (*fn)(const char *cgroup, void *arg), 52 extern int alloc_anon(const char *cgroup, void *arg); 56 extern int cg_killall(const char *cgroup); [all …]
|
H A D | cgroup_util.c | 227 int cg_create(const char *cgroup) in cg_create() argument 229 return mkdir(cgroup, 0755); in cg_create() 257 int cg_killall(const char *cgroup) in cg_killall() argument 289 if (!cgroup) in cg_destroy() 292 ret = rmdir(cgroup); in cg_destroy() 294 cg_killall(cgroup); in cg_destroy() 323 int cg_run(const char *cgroup, in cg_run() argument 338 exit(fn(cgroup, arg)); in cg_run() 356 .cgroup = cgroup_fd, in clone_into_cgroup() 435 exit(fn(cgroup, arg)); in clone_into_cgroup_run_nowait() [all …]
|
/openbmc/linux/kernel/bpf/ |
H 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 …]
|
H 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 …]
|
/openbmc/linux/tools/testing/selftests/bpf/progs/ |
H 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 …]
|
H 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()
|
H 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 …]
|
/openbmc/linux/tools/perf/util/ |
H A D | cgroup.c | 111 struct cgroup *cgroup = zalloc(sizeof(*cgroup)); in cgroup__new() local 117 if (!cgroup->name) in cgroup__new() 125 cgroup->fd = -1; in cgroup__new() 129 return cgroup; in cgroup__new() 134 free(cgroup); in cgroup__new() 140 struct cgroup *cgroup = evlist__find_cgroup(evlist, name); in evlist__findnew_cgroup() local 171 static void cgroup__delete(struct cgroup *cgroup) in cgroup__delete() argument 174 close(cgroup->fd); in cgroup__delete() 176 free(cgroup); in cgroup__delete() 186 struct cgroup *cgroup__get(struct cgroup *cgroup) in cgroup__get() argument [all …]
|
H 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 *evlist__findnew_cgroup(struct evlist *evlist, const char *name); 33 void evlist__set_default_cgroup(struct evlist *evlist, struct cgroup *cgroup); 37 struct cgroup *cgroup__findnew(struct perf_env *env, uint64_t id, 39 struct cgroup *cgroup__find(struct perf_env *env, uint64_t id); 44 int read_cgroup_id(struct cgroup *cgrp); 46 static inline int read_cgroup_id(struct cgroup *cgrp __maybe_unused) in read_cgroup_id()
|
/openbmc/linux/include/linux/ |
H A D | cgroup.h | 101 struct cgroup_subsys_state *cgroup_e_css(struct cgroup *cgroup, 103 struct cgroup_subsys_state *cgroup_get_e_css(struct cgroup *cgroup, 113 int cgroup_transfer_tasks(struct cgroup *to, struct cgroup *from); 495 static inline struct cgroup *cgroup_parent(struct cgroup *cgrp) in cgroup_parent() 532 static inline struct cgroup *cgroup_ancestor(struct cgroup *cgrp, in cgroup_ancestor() 640 struct cgroup; 668 static inline struct cgroup *cgroup_parent(struct cgroup *cgrp) in cgroup_parent() 716 struct cgroup *cgrp; in cgroup_account_cputime() 729 struct cgroup *cgrp; in cgroup_account_cputime_field() 760 return skcd->cgroup; in sock_cgroup_ptr() [all …]
|
/openbmc/linux/tools/bpf/bpftool/Documentation/ |
H A D | bpftool-cgroup.rst | 4 bpftool-cgroup 17 **bpftool** [*OPTIONS*] **cgroup** *COMMAND* 31 | **bpftool** **cgroup help** 62 bpftool uses cgroup v2 mountpoint. 77 some bpf program, the program in this cgroup yields to sub-cgroup 80 cgroup. 140 | **# mkdir /sys/fs/cgroup/test.slice** 142 | **# bpftool cgroup attach /sys/fs/cgroup/test.slice/ device id 1 allow_multi** 144 **# bpftool cgroup list /sys/fs/cgroup/test.slice/** 152 | **# bpftool cgroup detach /sys/fs/cgroup/test.slice/ device id 1** [all …]
|
/openbmc/linux/Documentation/admin-guide/cgroup-v1/ |
H 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 …]
|
H A D | pids.rst | 14 the number of tasks in a cgroup. 46 # mkdir -p /sys/fs/cgroup/pids 47 # mount -t cgroup -o pids none /sys/fs/cgroup/pids 51 # mkdir -p /sys/fs/cgroup/pids/parent/child 52 # echo 2 > /sys/fs/cgroup/pids/parent/pids.max 53 # echo $$ > /sys/fs/cgroup/pids/parent/cgroup.procs 54 # cat /sys/fs/cgroup/pids/parent/pids.current 61 # cat /sys/fs/cgroup/pids/parent/pids.current 71 # echo $$ > /sys/fs/cgroup/pids/parent/child/cgroup.procs 72 # cat /sys/fs/cgroup/pids/parent/pids.current [all …]
|
H 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 …]
|
H 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
|
H 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 …]
|
/openbmc/linux/include/trace/events/ |
H 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 …]
|
/openbmc/linux/kernel/cgroup/ |
H A D | cgroup-internal.h | 96 struct cgroup *cgrp; 184 static inline bool cgroup_is_dead(const struct cgroup *cgrp) in cgroup_is_dead() 222 bool cgroup_on_dfl(const struct cgroup *cgrp); 239 int cgroup_migrate_vet_dst(struct cgroup *dst_cgrp); 257 void cgroup_lock_and_drain_offline(struct cgroup *cgrp); 264 int __cgroup_task_count(const struct cgroup *cgrp); 265 int cgroup_task_count(const struct cgroup *cgrp); 270 int cgroup_rstat_init(struct cgroup *cgrp); 271 void cgroup_rstat_exit(struct cgroup *cgrp); 289 void cgroup1_pidlist_destroy_all(struct cgroup *cgrp); [all …]
|
H A D | rstat.c | 50 struct cgroup *parent = cgroup_parent(cgrp); in cgroup_rstat_updated() 91 static struct cgroup *cgroup_rstat_cpu_pop_updated(struct cgroup *pos, in cgroup_rstat_cpu_pop_updated() 92 struct cgroup *root, int cpu) in cgroup_rstat_cpu_pop_updated() 95 struct cgroup *parent; in cgroup_rstat_cpu_pop_updated() 130 struct cgroup **nextp; in cgroup_rstat_cpu_pop_updated() 167 struct cgroup *parent, int cpu) in bpf_rstat_flush() 184 struct cgroup *pos = NULL; in cgroup_rstat_flush_locked() 268 int cgroup_rstat_init(struct cgroup *cgrp) in cgroup_rstat_init() 290 void cgroup_rstat_exit(struct cgroup *cgrp) in cgroup_rstat_exit() 346 struct cgroup *parent = cgroup_parent(cgrp); in cgroup_base_stat_flush() [all …]
|
H A D | cgroup.c | 1680 struct cgroup *cgrp = css->cgroup; in css_clear_dir() 1713 struct cgroup *cgrp = css->cgroup; in css_populate_dir() 3149 struct cgroup *cgrp = css->cgroup; in css_visible() 3625 struct cgroup *cgroup = seq_css(seq)->cgroup; in cgroup_stat_show() local 4271 struct cgroup *cgrp = css->cgroup; in cgroup_apply_cftypes() 5337 struct cgroup *cgrp = css->cgroup; in css_free_rwork_fn() 5387 struct cgroup *cgrp = css->cgroup; in css_release_work_fn() 5689 struct cgroup *cgroup; in cgroup_check_hierarchy_limits() local 5695 for (cgroup = parent; cgroup; cgroup = cgroup_parent(cgroup)) { in cgroup_check_hierarchy_limits() 6940 struct cgroup *cgroup; in cgroup_sk_alloc() local [all …]
|
/openbmc/linux/Documentation/bpf/libbpf/ |
H 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 …]
|
/openbmc/linux/Documentation/admin-guide/ |
H A D | cgroup-v2.rst | 106 What is cgroup? 259 0::/test-cgroup/test-cgroup-nested 266 0::/test-cgroup/test-cgroup-nested (deleted) 800 All cgroup core files are prefixed with "cgroup." 802 cgroup.type 1285 (if the memory cgroup is not a leaf cgroup) are killed 1722 cgroup. 1777 cgroup. 2594 /batchjobs/container_id1 cgroup calls unshare, cgroup 2612 cgroup paths (in /proc/self/cgroup) only inside their root cgroup. [all …]
|
/openbmc/linux/tools/perf/tests/shell/ |
H 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} …
|