Home
last modified time | relevance | path

Searched refs:cgrp (Results 1 – 25 of 58) sorted by relevance

123

/Linux-v6.1/kernel/cgroup/
Dfreezer.c14 static void cgroup_propagate_frozen(struct cgroup *cgrp, bool frozen) in cgroup_propagate_frozen() argument
24 while ((cgrp = cgroup_parent(cgrp))) { in cgroup_propagate_frozen()
26 cgrp->freezer.nr_frozen_descendants += desc; in cgroup_propagate_frozen()
27 if (!test_bit(CGRP_FROZEN, &cgrp->flags) && in cgroup_propagate_frozen()
28 test_bit(CGRP_FREEZE, &cgrp->flags) && in cgroup_propagate_frozen()
29 cgrp->freezer.nr_frozen_descendants == in cgroup_propagate_frozen()
30 cgrp->nr_descendants) { in cgroup_propagate_frozen()
31 set_bit(CGRP_FROZEN, &cgrp->flags); in cgroup_propagate_frozen()
32 cgroup_file_notify(&cgrp->events_file); in cgroup_propagate_frozen()
33 TRACE_CGROUP_PATH(notify_frozen, cgrp, 1); in cgroup_propagate_frozen()
[all …]
Drstat.c13 static void cgroup_base_stat_flush(struct cgroup *cgrp, int cpu);
15 static struct cgroup_rstat_cpu *cgroup_rstat_cpu(struct cgroup *cgrp, int cpu) in cgroup_rstat_cpu() argument
17 return per_cpu_ptr(cgrp->rstat_cpu, cpu); in cgroup_rstat_cpu()
29 void cgroup_rstat_updated(struct cgroup *cgrp, int cpu) in cgroup_rstat_updated() argument
42 if (data_race(cgroup_rstat_cpu(cgrp, cpu)->updated_next)) in cgroup_rstat_updated()
49 struct cgroup_rstat_cpu *rstatc = cgroup_rstat_cpu(cgrp, cpu); in cgroup_rstat_updated()
50 struct cgroup *parent = cgroup_parent(cgrp); in cgroup_rstat_updated()
62 rstatc->updated_next = cgrp; in cgroup_rstat_updated()
68 prstatc->updated_children = cgrp; in cgroup_rstat_updated()
70 cgrp = parent; in cgroup_rstat_updated()
[all …]
Dcgroup.c166 struct cgroup_root cgrp_dfl_root = { .cgrp.rstat_cpu = &cgrp_dfl_root_rstat_cpu };
238 static int cgroup_apply_control(struct cgroup *cgrp);
239 static void cgroup_finalize_control(struct cgroup *cgrp, int ret);
242 static int cgroup_destroy_locked(struct cgroup *cgrp);
243 static struct cgroup_subsys_state *css_create(struct cgroup *cgrp,
248 struct cgroup *cgrp, struct cftype cfts[],
312 bool cgroup_on_dfl(const struct cgroup *cgrp) in cgroup_on_dfl() argument
314 return cgrp->root == &cgrp_dfl_root; in cgroup_on_dfl()
348 static bool cgroup_has_tasks(struct cgroup *cgrp) in cgroup_has_tasks() argument
350 return cgrp->nr_populated_csets; in cgroup_has_tasks()
[all …]
Dcgroup-internal.h27 #define TRACE_CGROUP_PATH(type, cgrp, ...) \ argument
33 cgroup_path(cgrp, trace_cgroup_path, \
35 trace_cgroup_##type(cgrp, trace_cgroup_path, \
96 struct cgroup *cgrp; member
184 static inline bool cgroup_is_dead(const struct cgroup *cgrp) in cgroup_is_dead() argument
186 return !(cgrp->self.flags & CSS_ONLINE); in cgroup_is_dead()
189 static inline bool notify_on_release(const struct cgroup *cgrp) in notify_on_release() argument
191 return test_bit(CGRP_NOTIFY_ON_RELEASE, &cgrp->flags); in notify_on_release()
222 bool cgroup_on_dfl(const struct cgroup *cgrp);
223 bool cgroup_is_thread_root(struct cgroup *cgrp);
[all …]
Dcgroup-v1.c196 void cgroup1_pidlist_destroy_all(struct cgroup *cgrp) in cgroup1_pidlist_destroy_all() argument
200 mutex_lock(&cgrp->pidlist_mutex); in cgroup1_pidlist_destroy_all()
201 list_for_each_entry_safe(l, tmp_l, &cgrp->pidlists, links) in cgroup1_pidlist_destroy_all()
203 mutex_unlock(&cgrp->pidlist_mutex); in cgroup1_pidlist_destroy_all()
206 BUG_ON(!list_empty(&cgrp->pidlists)); in cgroup1_pidlist_destroy_all()
277 static struct cgroup_pidlist *cgroup_pidlist_find(struct cgroup *cgrp, in cgroup_pidlist_find() argument
284 lockdep_assert_held(&cgrp->pidlist_mutex); in cgroup_pidlist_find()
286 list_for_each_entry(l, &cgrp->pidlists, links) in cgroup_pidlist_find()
298 static struct cgroup_pidlist *cgroup_pidlist_find_create(struct cgroup *cgrp, in cgroup_pidlist_find_create() argument
303 lockdep_assert_held(&cgrp->pidlist_mutex); in cgroup_pidlist_find_create()
[all …]
Ddebug.c101 struct cgroup *c = link->cgrp; in current_css_set_cg_links_read()
206 struct cgroup *cgrp; in cgroup_subsys_states_read() local
212 cgrp = cgroup_kn_lock_live(of->kn, false); in cgroup_subsys_states_read()
213 if (!cgrp) in cgroup_subsys_states_read()
217 css = rcu_dereference_check(cgrp->subsys[ss->id], true); in cgroup_subsys_states_read()
258 struct cgroup *cgrp; in cgroup_masks_read() local
260 cgrp = cgroup_kn_lock_live(of->kn, false); in cgroup_masks_read()
261 if (!cgrp) in cgroup_masks_read()
264 cgroup_masks_read_one(seq, "subtree_control", cgrp->subtree_control); in cgroup_masks_read()
265 cgroup_masks_read_one(seq, "subtree_ss_mask", cgrp->subtree_ss_mask); in cgroup_masks_read()
/Linux-v6.1/tools/perf/util/
Dcgroup.c51 int read_cgroup_id(struct cgroup *cgrp) in read_cgroup_id() argument
64 scnprintf(path, PATH_MAX, "%s/%s", mnt, cgrp->name); in read_cgroup_id()
70 cgrp->id = handle.cgroup_id; in read_cgroup_id()
100 if (!counter->cgrp) in evlist__find_cgroup()
102 if (!strcmp(counter->cgrp->name, str)) in evlist__find_cgroup()
103 return cgroup__get(counter->cgrp); in evlist__find_cgroup()
148 struct cgroup *cgrp = evlist__findnew_cgroup(evlist, str); in add_cgroup() local
151 if (!cgrp) in add_cgroup()
164 cgroup__put(cgrp); in add_cgroup()
167 counter->cgrp = cgrp; in add_cgroup()
[all …]
Dbpf_counter_cgroup.c48 struct cgroup *cgrp, *leader_cgrp; in bperf_load_program() local
109 cgrp = NULL; in bperf_load_program()
113 if (cgrp == NULL || evsel->cgrp == leader_cgrp) { in bperf_load_program()
114 leader_cgrp = evsel->cgrp; in bperf_load_program()
115 evsel->cgrp = NULL; in bperf_load_program()
137 evsel->cgrp = leader_cgrp; in bperf_load_program()
141 if (evsel->cgrp == cgrp) in bperf_load_program()
144 cgrp = evsel->cgrp; in bperf_load_program()
146 if (read_cgroup_id(cgrp) < 0) { in bperf_load_program()
153 err = bpf_map_update_elem(map_fd, &cgrp->id, &i, BPF_ANY); in bperf_load_program()
[all …]
Dbpf_off_cpu.c180 if (evlist__first(evlist)->cgrp) { in off_cpu_prepare()
249 if (evlist__first(evlist)->cgrp) { in off_cpu_prepare()
257 struct cgroup *cgrp = evsel->cgrp; in off_cpu_prepare() local
259 if (cgrp == NULL) in off_cpu_prepare()
262 if (!cgrp->id && read_cgroup_id(cgrp) < 0) { in off_cpu_prepare()
264 cgrp->name); in off_cpu_prepare()
268 bpf_map_update_elem(fd, &cgrp->id, &val, BPF_ANY); in off_cpu_prepare()
/Linux-v6.1/include/linux/
Dcgroup.h313 static inline u64 cgroup_id(const struct cgroup *cgrp) in cgroup_id() argument
315 return cgrp->kn->id; in cgroup_id()
423 static inline void cgroup_get(struct cgroup *cgrp) in cgroup_get() argument
425 css_get(&cgrp->self); in cgroup_get()
428 static inline bool cgroup_tryget(struct cgroup *cgrp) in cgroup_tryget() argument
430 return css_tryget(&cgrp->self); in cgroup_tryget()
433 static inline void cgroup_put(struct cgroup *cgrp) in cgroup_put() argument
435 css_put(&cgrp->self); in cgroup_put()
568 static inline struct cgroup *cgroup_parent(struct cgroup *cgrp) in cgroup_parent() argument
570 struct cgroup_subsys_state *parent_css = cgrp->self.parent; in cgroup_parent()
[all …]
Dpsi.h34 static inline struct psi_group *cgroup_psi(struct cgroup *cgrp) in cgroup_psi() argument
36 return cgroup_ino(cgrp) == 1 ? &psi_system : cgrp->psi; in cgroup_psi()
39 int psi_cgroup_alloc(struct cgroup *cgrp);
40 void psi_cgroup_free(struct cgroup *cgrp);
53 static inline int psi_cgroup_alloc(struct cgroup *cgrp) in psi_cgroup_alloc() argument
57 static inline void psi_cgroup_free(struct cgroup *cgrp) in psi_cgroup_free() argument
/Linux-v6.1/include/trace/events/
Dcgroup.h56 TP_PROTO(struct cgroup *cgrp, const char *path),
58 TP_ARGS(cgrp, path),
68 __entry->root = cgrp->root->hierarchy_id;
69 __entry->id = cgroup_id(cgrp);
70 __entry->level = cgrp->level;
80 TP_PROTO(struct cgroup *cgrp, const char *path),
82 TP_ARGS(cgrp, path)
87 TP_PROTO(struct cgroup *cgrp, const char *path),
89 TP_ARGS(cgrp, path)
94 TP_PROTO(struct cgroup *cgrp, const char *path),
[all …]
/Linux-v6.1/kernel/bpf/
Dcgroup.c31 bpf_prog_run_array_cg(const struct cgroup_bpf *cgrp, in bpf_prog_run_array_cg() argument
46 array = rcu_dereference(cgrp->effective[atype]); in bpf_prog_run_array_cg()
71 struct cgroup *cgrp; in __cgroup_bpf_run_lsm_sock() local
80 cgrp = sock_cgroup_ptr(&sk->sk_cgrp_data); in __cgroup_bpf_run_lsm_sock()
81 if (likely(cgrp)) in __cgroup_bpf_run_lsm_sock()
82 ret = bpf_prog_run_array_cg(&cgrp->bpf, in __cgroup_bpf_run_lsm_sock()
93 struct cgroup *cgrp; in __cgroup_bpf_run_lsm_socket() local
102 cgrp = sock_cgroup_ptr(&sock->sk->sk_cgrp_data); in __cgroup_bpf_run_lsm_socket()
103 if (likely(cgrp)) in __cgroup_bpf_run_lsm_socket()
104 ret = bpf_prog_run_array_cg(&cgrp->bpf, in __cgroup_bpf_run_lsm_socket()
[all …]
Dcgroup_iter.c165 struct cgroup *cgrp = aux->cgroup.start; in BTF_ID_LIST_SINGLE() local
167 p->start_css = &cgrp->self; in BTF_ID_LIST_SINGLE()
187 struct cgroup *cgrp; in bpf_iter_attach_cgroup() local
199 cgrp = cgroup_v1v2_get_from_fd(fd); in bpf_iter_attach_cgroup()
201 cgrp = cgroup_get_from_id(id); in bpf_iter_attach_cgroup()
203 cgrp = cgroup_get_from_path("/"); in bpf_iter_attach_cgroup()
205 if (IS_ERR(cgrp)) in bpf_iter_attach_cgroup()
206 return PTR_ERR(cgrp); in bpf_iter_attach_cgroup()
208 aux->cgroup.start = cgrp; in bpf_iter_attach_cgroup()
/Linux-v6.1/tools/testing/selftests/bpf/
Dtest_sockmap.c1376 static int __test_exec(int cgrp, int test, struct sockmap_options *opt) in __test_exec() argument
1400 err = run_options(opt, cgrp, test); in __test_exec()
1409 static void test_exec(int cgrp, struct sockmap_options *opt) in test_exec() argument
1416 err = __test_exec(cgrp, SENDMSG, opt); in test_exec()
1421 err = __test_exec(cgrp, SENDPAGE, opt); in test_exec()
1427 static void test_send_one(struct sockmap_options *opt, int cgrp) in test_send_one() argument
1432 test_exec(cgrp, opt); in test_send_one()
1437 test_exec(cgrp, opt); in test_send_one()
1442 test_exec(cgrp, opt); in test_send_one()
1446 static void test_send_many(struct sockmap_options *opt, int cgrp) in test_send_many() argument
[all …]
/Linux-v6.1/tools/testing/selftests/bpf/progs/
Dcgroup_hierarchical_stats.c40 extern void cgroup_rstat_updated(struct cgroup *cgrp, int cpu) __ksym;
41 extern void cgroup_rstat_flush(struct cgroup *cgrp) __ksym;
43 static uint64_t cgroup_id(struct cgroup *cgrp) in cgroup_id() argument
45 return cgrp->kn->id; in cgroup_id()
83 int BPF_PROG(flusher, struct cgroup *cgrp, struct cgroup *parent, int cpu) in BPF_PROG() argument
87 __u64 cg_id = cgroup_id(cgrp); in BPF_PROG()
133 int BPF_PROG(dumper, struct bpf_iter_meta *meta, struct cgroup *cgrp) in BPF_PROG() argument
137 __u64 cg_id = cgrp ? cgroup_id(cgrp) : 0; in BPF_PROG()
144 cgroup_rstat_flush(cgrp); in BPF_PROG()
Dcgroup_iter.c12 static inline u64 cgroup_id(struct cgroup *cgrp) in cgroup_id() argument
14 return cgrp->kn->id; in cgroup_id()
21 struct cgroup *cgrp = ctx->cgroup; in cgroup_id_printer() local
24 if (cgrp == NULL) { in cgroup_id_printer()
33 BPF_SEQ_PRINTF(seq, "%8llu\n", cgroup_id(cgrp)); in cgroup_id_printer()
35 if (terminal_cgroup == cgroup_id(cgrp)) in cgroup_id_printer()
Dbtf_type_tag_percpu.c46 int BPF_PROG(test_percpu_load, struct cgroup *cgrp, const char *path) in BPF_PROG() argument
48 g = (__u64)cgrp->rstat_cpu->updated_children; in BPF_PROG()
53 int BPF_PROG(test_percpu_helper, struct cgroup *cgrp, const char *path) in BPF_PROG() argument
59 rstat = (struct cgroup_rstat_cpu *)bpf_per_cpu_ptr(cgrp->rstat_cpu, cpu); in BPF_PROG()
/Linux-v6.1/block/
Dblk-cgroup-fc-appid.c13 struct cgroup *cgrp; in blkcg_set_fc_appid() local
21 cgrp = cgroup_get_from_id(cgrp_id); in blkcg_set_fc_appid()
22 if (IS_ERR(cgrp)) in blkcg_set_fc_appid()
23 return PTR_ERR(cgrp); in blkcg_set_fc_appid()
24 css = cgroup_get_e_css(cgrp, &io_cgrp_subsys); in blkcg_set_fc_appid()
40 cgroup_put(cgrp); in blkcg_set_fc_appid()
/Linux-v6.1/tools/perf/util/bpf_skel/
Dbperf_cgroup.bpf.c65 static inline __u64 get_cgroup_v1_ancestor_id(struct cgroup *cgrp, int level) in get_cgroup_v1_ancestor_id() argument
68 struct cgroup___new *cgrp_new = (void *)cgrp; in get_cgroup_v1_ancestor_id()
74 struct cgroup___old *cgrp_old = (void *)cgrp; in get_cgroup_v1_ancestor_id()
83 struct cgroup *cgrp; in get_cgroup_v1_idx() local
97 cgrp = BPF_CORE_READ(p, cgroups, subsys[perf_subsys_id], cgroup); in get_cgroup_v1_idx()
98 level = BPF_CORE_READ(cgrp, level); in get_cgroup_v1_idx()
107 cgrp_id = get_cgroup_v1_ancestor_id(cgrp, i); in get_cgroup_v1_idx()
153 __u32 key, cgrp; in bperf_cgroup_count() local
193 cgrp = cgrp_idx[c]; in bperf_cgroup_count()
196 key = cgrp * num_events + idx; in bperf_cgroup_count()
/Linux-v6.1/net/netfilter/
Dxt_cgroup.c39 struct cgroup *cgrp; in cgroup_mt_check_v1() local
56 cgrp = cgroup_get_from_path(info->path); in cgroup_mt_check_v1()
57 if (IS_ERR(cgrp)) { in cgroup_mt_check_v1()
59 PTR_ERR(cgrp)); in cgroup_mt_check_v1()
62 info->priv = cgrp; in cgroup_mt_check_v1()
71 struct cgroup *cgrp; in cgroup_mt_check_v2() local
88 cgrp = cgroup_get_from_path(info->path); in cgroup_mt_check_v2()
89 if (IS_ERR(cgrp)) { in cgroup_mt_check_v2()
91 PTR_ERR(cgrp)); in cgroup_mt_check_v2()
94 info->priv = cgrp; in cgroup_mt_check_v2()
/Linux-v6.1/drivers/gpu/drm/nouveau/nvkm/engine/fifo/
Dgpfifogk104.c44 struct nvkm_fifo_cgrp *cgrp = chan->cgrp; in gk104_fifo_gpfifo_kick_locked() local
47 if (cgrp) in gk104_fifo_gpfifo_kick_locked()
48 nvkm_wr32(device, 0x002634, cgrp->id | 0x01000000); in gk104_fifo_gpfifo_kick_locked()
56 cgrp ? "tsg" : "channel", in gk104_fifo_gpfifo_kick_locked()
57 cgrp ? cgrp->id : chan->base.chid, client->name); in gk104_fifo_gpfifo_kick_locked()
240 kfree(chan->cgrp); in gk104_fifo_gpfifo_dtor()
292 if (!(chan->cgrp = kmalloc(sizeof(*chan->cgrp), GFP_KERNEL))) in gk104_fifo_gpfifo_new_()
294 chan->cgrp->id = chan->base.chid; in gk104_fifo_gpfifo_new_()
295 INIT_LIST_HEAD(&chan->cgrp->head); in gk104_fifo_gpfifo_new_()
296 INIT_LIST_HEAD(&chan->cgrp->chan); in gk104_fifo_gpfifo_new_()
[all …]
Dgk110.c33 gk110_fifo_runlist_cgrp(struct nvkm_fifo_cgrp *cgrp, in gk110_fifo_runlist_cgrp() argument
36 nvkm_wo32(memory, offset + 0, (cgrp->chan_nr << 26) | (128 << 18) | in gk110_fifo_runlist_cgrp()
37 (3 << 14) | 0x00002000 | cgrp->id); in gk110_fifo_runlist_cgrp()
44 .cgrp = gk110_fifo_runlist_cgrp,
Dgk104.c172 struct nvkm_fifo_cgrp *cgrp; in gk104_fifo_runlist_update() local
184 list_for_each_entry(cgrp, &fifo->runlist[runl].cgrp, head) { in gk104_fifo_runlist_update()
185 func->cgrp(cgrp, mem, nr++ * func->size); in gk104_fifo_runlist_update()
186 list_for_each_entry(chan, &cgrp->chan, head) { in gk104_fifo_runlist_update()
199 struct nvkm_fifo_cgrp *cgrp = chan->cgrp; in gk104_fifo_runlist_remove() local
203 if (cgrp && !--cgrp->chan_nr) in gk104_fifo_runlist_remove()
204 list_del_init(&cgrp->head); in gk104_fifo_runlist_remove()
212 struct nvkm_fifo_cgrp *cgrp = chan->cgrp; in gk104_fifo_runlist_insert() local
214 if (cgrp) { in gk104_fifo_runlist_insert()
215 if (!cgrp->chan_nr++) in gk104_fifo_runlist_insert()
[all …]
Dgv100.c46 gv100_fifo_runlist_cgrp(struct nvkm_fifo_cgrp *cgrp, in gv100_fifo_runlist_cgrp() argument
50 nvkm_wo32(memory, offset + 0x4, cgrp->chan_nr); in gv100_fifo_runlist_cgrp()
51 nvkm_wo32(memory, offset + 0x8, cgrp->id); in gv100_fifo_runlist_cgrp()
58 .cgrp = gv100_fifo_runlist_cgrp,

123