| /OK3568_Linux_fs/kernel/tools/testing/selftests/cgroup/ |
| H A D | test_freezer.c | 29 static int cg_check_frozen(const char *cgroup, bool frozen) in cg_check_frozen() argument 32 if (cg_read_strstr(cgroup, "cgroup.events", "frozen 1") != 0) { in cg_check_frozen() 33 debug("Cgroup %s isn't frozen\n", cgroup); in cg_check_frozen() 40 if (cg_read_strstr(cgroup, "cgroup.events", "frozen 0") != 0) { in cg_check_frozen() 41 debug("Cgroup %s is frozen\n", cgroup); in cg_check_frozen() 52 static int cg_freeze_nowait(const char *cgroup, bool freeze) in cg_freeze_nowait() argument 54 return cg_write(cgroup, "cgroup.freeze", freeze ? "1" : "0"); in cg_freeze_nowait() 60 static int cg_prepare_for_wait(const char *cgroup) in cg_prepare_for_wait() argument 70 ret = inotify_add_watch(fd, cg_control(cgroup, "cgroup.events"), in cg_prepare_for_wait() 116 static int cg_enter_and_wait_for_frozen(const char *cgroup, int pid, in cg_enter_and_wait_for_frozen() argument [all …]
|
| H A D | cgroup_util.h | 22 extern char *cg_control(const char *cgroup, const char *control); 23 extern int cg_create(const char *cgroup); 24 extern int cg_destroy(const char *cgroup); 25 extern int cg_read(const char *cgroup, const char *control, 27 extern int cg_read_strcmp(const char *cgroup, const char *control, 29 extern int cg_read_strstr(const char *cgroup, const char *control, 31 extern long cg_read_long(const char *cgroup, const char *control); 32 long cg_read_key_long(const char *cgroup, const char *control, const char *key); 33 extern long cg_read_lc(const char *cgroup, const char *control); 34 extern int cg_write(const char *cgroup, const char *control, char *buf); [all …]
|
| H A D | cgroup_util.c | 78 char *cg_control(const char *cgroup, const char *control) in cg_control() argument 80 size_t len = strlen(cgroup) + strlen(control) + 2; in cg_control() 83 snprintf(ret, len, "%s/%s", cgroup, control); in cg_control() 88 int cg_read(const char *cgroup, const char *control, char *buf, size_t len) in cg_read() argument 92 snprintf(path, sizeof(path), "%s/%s", cgroup, control); in cg_read() 100 int cg_read_strcmp(const char *cgroup, const char *control, in cg_read_strcmp() argument 117 if (cg_read(cgroup, control, buf, size)) { in cg_read_strcmp() 127 int cg_read_strstr(const char *cgroup, const char *control, const char *needle) in cg_read_strstr() argument 131 if (cg_read(cgroup, control, buf, sizeof(buf))) in cg_read_strstr() 137 long cg_read_long(const char *cgroup, const char *control) in cg_read_long() argument [all …]
|
| /OK3568_Linux_fs/kernel/tools/perf/util/ |
| H A D | cgroup.c | 38 static struct cgroup *evlist__find_cgroup(struct evlist *evlist, const char *str) in evlist__find_cgroup() 54 static struct cgroup *cgroup__new(const char *name, bool do_open) in cgroup__new() 56 struct cgroup *cgroup = zalloc(sizeof(*cgroup)); in cgroup__new() local 58 if (cgroup != NULL) { in cgroup__new() 59 refcount_set(&cgroup->refcnt, 1); in cgroup__new() 61 cgroup->name = strdup(name); in cgroup__new() 62 if (!cgroup->name) in cgroup__new() 66 cgroup->fd = open_cgroup(name); in cgroup__new() 67 if (cgroup->fd == -1) in cgroup__new() 70 cgroup->fd = -1; in cgroup__new() [all …]
|
| H A D | cgroup.h | 11 struct cgroup { struct 21 struct cgroup *cgroup__get(struct cgroup *cgroup); argument 22 void cgroup__put(struct cgroup *cgroup); 27 struct cgroup *evlist__findnew_cgroup(struct evlist *evlist, const char *name); 31 void evlist__set_default_cgroup(struct evlist *evlist, struct cgroup *cgroup); 35 struct cgroup *cgroup__findnew(struct perf_env *env, uint64_t id, 37 struct cgroup *cgroup__find(struct perf_env *env, uint64_t id);
|
| /OK3568_Linux_fs/kernel/include/linux/ |
| H A D | cgroup.h | 105 struct cgroup_subsys_state *cgroup_e_css(struct cgroup *cgroup, 107 struct cgroup_subsys_state *cgroup_get_e_css(struct cgroup *cgroup, 112 struct cgroup *cgroup_get_from_path(const char *path); 113 struct cgroup *cgroup_get_from_fd(int fd); 116 int cgroup_transfer_tasks(struct cgroup *to, struct cgroup *from); 315 static inline u64 cgroup_id(struct cgroup *cgrp) in cgroup_id() 425 static inline void cgroup_get(struct cgroup *cgrp) in cgroup_get() 430 static inline bool cgroup_tryget(struct cgroup *cgrp) in cgroup_tryget() 435 static inline void cgroup_put(struct cgroup *cgrp) in cgroup_put() 547 static inline struct cgroup *task_cgroup(struct task_struct *task, in task_cgroup() [all …]
|
| /OK3568_Linux_fs/kernel/tools/bpf/bpftool/Documentation/ |
| H A D | bpftool-cgroup.rst | 2 bpftool-cgroup 13 **bpftool** [*OPTIONS*] **cgroup** *COMMAND* 23 | **bpftool** **cgroup** { **show** | **list** } *CGROUP* [**effective**] 24 | **bpftool** **cgroup tree** [*CGROUP_ROOT*] [**effective**] 25 | **bpftool** **cgroup attach** *CGROUP* *ATTACH_TYPE* *PROG* [*ATTACH_FLAGS*] 26 | **bpftool** **cgroup detach** *CGROUP* *ATTACH_TYPE* *PROG* 27 | **bpftool** **cgroup help** 39 **bpftool cgroup { show | list }** *CGROUP* [**effective**] 40 List all programs attached to the cgroup *CGROUP*. 46 will execute for events within a cgroup. This includes [all …]
|
| /OK3568_Linux_fs/kernel/Documentation/admin-guide/cgroup-v1/ |
| H A D | cgroups.rst | 6 Documentation/admin-guide/cgroup-v1/cpusets.rst 50 A *cgroup* associates a set of tasks with a set of parameters for one 56 schedules a resource or applies per-cgroup limits, but it may be 63 state attached to each cgroup in the hierarchy. Each hierarchy has 64 an instance of the cgroup virtual filesystem associated with it. 70 instance of the cgroup virtual file system, specify and query to 71 which cgroup a task is assigned, and list the task PIDs assigned to 72 a cgroup. Those creations and assignments only affect the hierarchy 73 associated with that instance of the cgroup file system. 77 cgroup support to provide new attributes for cgroups, such as [all …]
|
| H A D | pids.rst | 8 The process number controller is used to allow a cgroup hierarchy to stop any 13 preventable in the scope of a cgroup hierarchy by allowing resource limiting of 14 the number of tasks in a cgroup. 20 pids.max (this is not available in the root cgroup for obvious reasons). The 21 number of processes currently in the cgroup is given by pids.current. 23 Organisational operations are not blocked by cgroup policies, so it is possible 25 be smaller than pids.current, or attaching enough processes to the cgroup such 26 that pids.current > pids.max. However, it is not possible to violate a cgroup 28 creation of a new process would cause a cgroup policy to be violated. 30 To set a cgroup to have no limit, set pids.max to "max". This is the default for [all …]
|
| H A D | freezer-subsystem.rst | 5 The cgroup freezer is useful to batch job management system which start 9 whole. The cgroup freezer uses cgroups to describe the set of tasks to 13 The cgroup freezer will also be useful for checkpointing running groups 15 image of the tasks by attempting to force the tasks in a cgroup into a 51 In contrast, the cgroup freezer uses the kernel freezer code to 56 The cgroup freezer is hierarchical. Freezing a cgroup freezes all 57 tasks belonging to the cgroup and all its descendant cgroups. Each 58 cgroup has its own state (self-state) and the state inherited from the 59 parent (parent-state). Iff both states are THAWED, the cgroup is 62 The following cgroupfs files are created by cgroup freezer. [all …]
|
| H A D | rdma.rst | 23 cgroup. 30 in other cgroup or kernel space ULPs may not even get chance to allocate any 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 46 are 0 to 4 resource pool instances per cgroup, per device in most use cases. 48 single cgroup may not be handled optimally, however there is no 53 always owned by the creator cgroup css. This allows process migration from one 54 to other cgroup without major complexity of transferring resource ownership; [all …]
|
| H A D | memcg_test.rst | 13 (*) Topics on API should be in Documentation/admin-guide/cgroup-v1/memory.rst) 177 mount -t cgroup -o cpuset none /opt/cpuset 228 echo 1 >/opt/cgroup/01/memory/use_hierarchy 229 mkdir /opt/cgroup/01/child_a 230 mkdir /opt/cgroup/01/child_b 238 /opt/cgroup/01/child_a/child_aa 239 /opt/cgroup/01/child_b/child_bb 240 /opt/cgroup/01/child_c 248 race and lock dependency with other cgroup subsystems. 252 # mount -t cgroup none /cgroup -o cpuset,memory,cpu,devices [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 | 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 …]
|
| H A D | net_prio.rst | 2 Network priority cgroup 5 The Network priority cgroup provides an interface to allow an administrator to 16 This cgroup allows an administrator to assign a process to a group which defines 18 be created by first mounting the cgroup filesystem:: 20 # mount -t cgroup -onet_prio none /sys/fs/cgroup/net_prio 23 becomes visible at '/sys/fs/cgroup/net_prio'. This group includes all tasks in 24 the system. '/sys/fs/cgroup/net_prio/tasks' lists the tasks in this cgroup. 26 Each net_prio cgroup contains two files that are subsystem specific 31 cgroup. 43 iscsi net_prio cgroup and egressing on interface eth0 to have the priority of [all …]
|
| H A D | memory.rst | 17 When we mention a cgroup (cgroupfs's directory) with memory controller, 18 we call it "memory cgroup". When you see git-log and source code, you'll 32 b. Create a cgroup with a limited amount of memory; this can be used 55 - Root cgroup has no limit controls. 65 cgroup.procs show list of processes 66 cgroup.event_control an interface for event_fd() 142 processes associated with the controller. Each cgroup has a memory controller 173 1. Accounting happens per cgroup 174 2. Each mm_struct knows about which cgroup it belongs to 176 cgroup it belongs to [all …]
|
| /OK3568_Linux_fs/kernel/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, 94 TP_PROTO(struct cgroup *cgrp, const char *path), 99 DEFINE_EVENT(cgroup, cgroup_rename, [all …]
|
| /OK3568_Linux_fs/kernel/kernel/cgroup/ |
| H A D | cgroup-internal.h | 97 struct cgroup *cgrp; 186 static inline bool cgroup_is_dead(const struct cgroup *cgrp) in cgroup_is_dead() 191 static inline bool notify_on_release(const struct cgroup *cgrp) in notify_on_release() 224 bool cgroup_on_dfl(const struct cgroup *cgrp); 225 bool cgroup_is_thread_root(struct cgroup *cgrp); 226 bool cgroup_is_threaded(struct cgroup *cgrp); 229 struct cgroup *task_cgroup_from_root(struct task_struct *task, 231 struct cgroup *cgroup_kn_lock_live(struct kernfs_node *kn, bool drain_offline); 233 int cgroup_path_ns_locked(struct cgroup *cgrp, char *buf, size_t buflen, 242 int cgroup_migrate_vet_dst(struct cgroup *dst_cgrp); [all …]
|
| H A D | rstat.c | 9 static void cgroup_base_stat_flush(struct cgroup *cgrp, int cpu); 11 static struct cgroup_rstat_cpu *cgroup_rstat_cpu(struct cgroup *cgrp, int cpu) in cgroup_rstat_cpu() 25 void cgroup_rstat_updated(struct cgroup *cgrp, int cpu) in cgroup_rstat_updated() 28 struct cgroup *parent; in cgroup_rstat_updated() 83 static struct cgroup *cgroup_rstat_cpu_pop_updated(struct cgroup *pos, in cgroup_rstat_cpu_pop_updated() 84 struct cgroup *root, int cpu) in cgroup_rstat_cpu_pop_updated() 115 struct cgroup *parent = cgroup_parent(pos); in cgroup_rstat_cpu_pop_updated() 118 struct cgroup **nextp; in cgroup_rstat_cpu_pop_updated() 141 static void cgroup_rstat_flush_locked(struct cgroup *cgrp, bool may_sleep) in cgroup_rstat_flush_locked() 151 struct cgroup *pos = NULL; in cgroup_rstat_flush_locked() [all …]
|
| H A D | cgroup.c | 231 static int cgroup_apply_control(struct cgroup *cgrp); 232 static void cgroup_finalize_control(struct cgroup *cgrp, int ret); 235 static int cgroup_destroy_locked(struct cgroup *cgrp); 236 static struct cgroup_subsys_state *css_create(struct cgroup *cgrp, 241 struct cgroup *cgrp, struct cftype cfts[], 310 bool cgroup_on_dfl(const struct cgroup *cgrp) in cgroup_on_dfl() 346 static bool cgroup_has_tasks(struct cgroup *cgrp) in cgroup_has_tasks() 351 bool cgroup_is_threaded(struct cgroup *cgrp) in cgroup_is_threaded() 357 static bool cgroup_is_mixable(struct cgroup *cgrp) in cgroup_is_mixable() 368 static bool cgroup_can_be_thread_root(struct cgroup *cgrp) in cgroup_can_be_thread_root() [all …]
|
| H A D | freezer.c | 14 static void cgroup_propagate_frozen(struct cgroup *cgrp, bool frozen) in cgroup_propagate_frozen() 52 void cgroup_update_frozen(struct cgroup *cgrp) in cgroup_update_frozen() 89 static void cgroup_inc_frozen_cnt(struct cgroup *cgrp) in cgroup_inc_frozen_cnt() 97 static void cgroup_dec_frozen_cnt(struct cgroup *cgrp) in cgroup_dec_frozen_cnt() 109 struct cgroup *cgrp; in cgroup_enter_frozen() 133 struct cgroup *cgrp; in cgroup_leave_frozen() 177 static void cgroup_do_freeze(struct cgroup *cgrp, bool freeze) in cgroup_do_freeze() 223 struct cgroup *src, struct cgroup *dst) in cgroup_freezer_migrate_task() 260 void cgroup_freeze(struct cgroup *cgrp, bool freeze) in cgroup_freeze() 263 struct cgroup *dsct; in cgroup_freeze() [all …]
|
| /OK3568_Linux_fs/kernel/Documentation/admin-guide/ |
| H A D | cgroup-v2.rst | 9 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 :ref:`Documentation/admin-guide/cgroup-v1/index.rst <cgroup-v1>`. 18 1-2. What is cgroup? 70 5-N-1. CPU controller root cgroup process behaviour 71 5-N-2. IO controller root cgroup process behaviour 95 "cgroup" stands for "control group" and is never capitalized. The 97 qualifier as in "cgroup controllers". When explicitly referring to 101 What is cgroup? 104 cgroup is a mechanism to organize processes hierarchically and [all …]
|
| /OK3568_Linux_fs/kernel/tools/testing/selftests/vm/ |
| H A D | charge_reserved_hugetlb.sh | 24 cgroup_path=/dev/cgroup/memory 30 mount -t cgroup memory,hugetlb $cgroup_path 35 echo "+hugetlb" >/dev/cgroup/memory/cgroup.subtree_control 40 echo $$ >$cgroup_path/cgroup.procs 91 echo writing cgroup limit: "$cgroup_limit" 107 local cgroup="$1" 108 local path="/dev/cgroup/memory/$cgroup/hugetlb.${MB}MB.$reservation_usage_file" 118 local cgroup="$1" 121 local path="/dev/cgroup/memory/$cgroup/hugetlb.${MB}MB.$reservation_usage_file" 131 local cgroup="$1" [all …]
|
| /OK3568_Linux_fs/kernel/kernel/bpf/ |
| H A D | cgroup.c | 25 void cgroup_bpf_offline(struct cgroup *cgrp) in cgroup_bpf_offline() 43 struct cgroup *cgrp) in bpf_cgroup_storages_alloc() 83 struct cgroup *cgrp, in bpf_cgroup_storages_link() 99 cgroup_put(link->cgroup); in bpf_cgroup_link_auto_detach() 100 link->cgroup = NULL; in bpf_cgroup_link_auto_detach() 110 struct cgroup *p, *cgrp = container_of(work, struct cgroup, in cgroup_bpf_release() 160 struct cgroup *cgrp = container_of(ref, struct cgroup, bpf.refcnt); in cgroup_bpf_release_fn() 198 static bool hierarchy_allows_attach(struct cgroup *cgrp, in hierarchy_allows_attach() 201 struct cgroup *p; in hierarchy_allows_attach() 227 static int compute_effective_progs(struct cgroup *cgrp, in compute_effective_progs() [all …]
|
| /OK3568_Linux_fs/kernel/Documentation/accounting/ |
| H A D | cgroupstats.rst | 6 http://lkml.org/lkml/2007/4/11/187 and implements per cgroup statistics as 9 Per cgroup statistics infrastructure re-uses code from the taskstats 10 interface. A new set of cgroup operations are registered with commands 12 extend per cgroup statistics, by adding members to the cgroupstats 17 user space requests for statistics by passing the cgroup path. 18 Statistics about the state of all the tasks in the cgroup is returned to 25 To extract cgroup statistics a utility very similar to getdelays.c 28 ~/balbir/cgroupstats # ./getdelays -C "/sys/fs/cgroup/a" 30 ~/balbir/cgroupstats # ./getdelays -C "/sys/fs/cgroup"
|