/linux-6.3-rc2/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 | 26 extern int cg_create(const char *cgroup); 27 extern int cg_destroy(const char *cgroup); 39 extern int cg_run(const char *cgroup, 40 int (*fn)(const char *cgroup, void *arg), 42 extern int cg_enter(const char *cgroup, int pid); 43 extern int cg_enter_current(const char *cgroup); 45 extern int cg_run_nowait(const char *cgroup, 46 int (*fn)(const char *cgroup, void *arg), 50 extern int alloc_anon(const char *cgroup, void *arg); 54 extern int cg_killall(const char *cgroup); [all …]
|
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 285 int cg_destroy(const char *cgroup) in cg_destroy() argument 290 ret = rmdir(cgroup); in cg_destroy() 292 cg_killall(cgroup); in cg_destroy() 321 int cg_run(const char *cgroup, in cg_run() argument 336 exit(fn(cgroup, arg)); in cg_run() 354 .cgroup = cgroup_fd, in clone_into_cgroup() 433 exit(fn(cgroup, arg)); in clone_into_cgroup_run_nowait() [all …]
|
/linux-6.3-rc2/kernel/bpf/ |
A D | bpf_cgrp_storage.c | 46 void bpf_cgrp_storage_free(struct cgroup *cgroup) in bpf_cgrp_storage_free() argument 88 struct cgroup *cgroup; in bpf_cgrp_storage_lookup_elem() local 93 if (IS_ERR(cgroup)) in bpf_cgrp_storage_lookup_elem() 99 cgroup_put(cgroup); in bpf_cgrp_storage_lookup_elem() 107 struct cgroup *cgroup; in bpf_cgrp_storage_update_elem() local 112 if (IS_ERR(cgroup)) in bpf_cgrp_storage_update_elem() 119 cgroup_put(cgroup); in bpf_cgrp_storage_update_elem() 137 struct cgroup *cgroup; in bpf_cgrp_storage_delete_elem() local 142 if (IS_ERR(cgroup)) in bpf_cgrp_storage_delete_elem() 177 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-6.3-rc2/tools/testing/selftests/bpf/progs/ |
A D | cgrp_kfunc_failure.c | 35 struct cgroup *acquired; in BPF_PROG() 53 struct cgroup *acquired, *stack_cgrp = (struct cgroup *)&path; in BPF_PROG() 66 struct cgroup *acquired; in BPF_PROG() 79 struct cgroup *acquired; in BPF_PROG() 92 struct cgroup *acquired; in BPF_PROG() 107 struct cgroup *acquired; in BPF_PROG() 120 struct cgroup *kptr; in BPF_PROG() 155 struct cgroup *kptr; in BPF_PROG() 171 struct cgroup *kptr; in BPF_PROG() 191 struct cgroup *kptr; in BPF_PROG() [all …]
|
A D | cgrp_kfunc_common.h | 13 struct cgroup __kptr_ref * cgrp; 23 struct cgroup *bpf_cgroup_acquire(struct cgroup *p) __ksym; 24 struct cgroup *bpf_cgroup_kptr_get(struct cgroup **pp) __ksym; 25 void bpf_cgroup_release(struct cgroup *p) __ksym; 26 struct cgroup *bpf_cgroup_ancestor(struct cgroup *cgrp, int level) __ksym; 28 static inline struct __cgrps_kfunc_map_value *cgrps_kfunc_map_value_lookup(struct cgroup *cgrp) in cgrps_kfunc_map_value_lookup() 40 static inline int cgrps_kfunc_map_insert(struct cgroup *cgrp) in cgrps_kfunc_map_insert() 44 struct cgroup *acquired, *old; in cgrps_kfunc_map_insert()
|
/linux-6.3-rc2/include/linux/ |
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); 496 static inline struct cgroup *cgroup_parent(struct cgroup *cgrp) in cgroup_parent() 533 static inline struct cgroup *cgroup_ancestor(struct cgroup *cgrp, in cgroup_ancestor() 641 struct cgroup; 669 static inline struct cgroup *cgroup_parent(struct cgroup *cgrp) in cgroup_parent() 718 struct cgroup *cgrp; in cgroup_account_cputime() 731 struct cgroup *cgrp; in cgroup_account_cputime_field() 762 return skcd->cgroup; in sock_cgroup_ptr() [all …]
|
/linux-6.3-rc2/tools/perf/util/ |
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 …]
|
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()
|
/linux-6.3-rc2/tools/bpf/bpftool/Documentation/ |
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 …]
|
/linux-6.3-rc2/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. 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 …]
|
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
|
A D | cpuacct.rst | 12 Accounting groups can be created by first mounting the cgroup filesystem:: 14 # mount -t cgroup -ocpuacct none /sys/fs/cgroup 17 visible at /sys/fs/cgroup. At bootup, this group includes all the tasks in 18 the system. /sys/fs/cgroup/tasks lists the tasks in this cgroup. 19 /sys/fs/cgroup/cpuacct.usage gives the CPU time (in nanoseconds) obtained 23 New accounting groups can be created under the parent group /sys/fs/cgroup:: 25 # cd /sys/fs/cgroup 32 /sys/fs/cgroup/cpuacct.usage also. 35 CPU time obtained by the cgroup into user and system times. Currently 38 user: Time spent by tasks of the cgroup in user mode. [all …]
|
/linux-6.3-rc2/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-6.3-rc2/kernel/cgroup/ |
A D | cgroup-internal.h | 96 struct cgroup *cgrp; 222 bool cgroup_on_dfl(const struct cgroup *cgrp); 223 bool cgroup_is_thread_root(struct cgroup *cgrp); 224 bool cgroup_is_threaded(struct cgroup *cgrp); 241 int cgroup_migrate_vet_dst(struct cgroup *dst_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 | 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() 284 int cgroup_rstat_init(struct cgroup *cgrp) in cgroup_rstat_init() 306 void cgroup_rstat_exit(struct cgroup *cgrp) in cgroup_rstat_exit() 362 struct cgroup *parent = cgroup_parent(cgrp); in cgroup_base_stat_flush() [all …]
|
A D | cgroup.c | 1708 struct cgroup *cgrp = css->cgroup; in css_clear_dir() 1741 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 4271 struct cgroup *cgrp = css->cgroup; in cgroup_apply_cftypes() 5336 struct cgroup *cgrp = css->cgroup; in css_free_rwork_fn() 5386 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 …]
|
/linux-6.3-rc2/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-6.3-rc2/Documentation/admin-guide/ |
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 1287 (if the memory cgroup is not a leaf cgroup) are killed 1717 cgroup. 1772 cgroup. 2583 /batchjobs/container_id1 cgroup calls unshare, cgroup 2601 cgroup paths (in /proc/self/cgroup) only inside their root cgroup. [all …]
|
/linux-6.3-rc2/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 -a -d /sys/fs/cgroup/user.slice ]; then 34 local self_cgrp=$(grep perf_event /proc/self/cgroup | cut -d: -f3) 37 self_cgrp=$(grep ^0: /proc/self/cgroup | cut -d: -f3) 53 …output=$(perf stat -a --bpf-counters --for-each-cgroup ${test_cgroups} -e cpu-clock -x, sleep 1 2… 67 …output=$(perf stat -C 1 --bpf-counters --for-each-cgroup ${test_cgroups} -e cpu-clock -x, taskset …
|