Lines Matching refs:cgroup
240 static int cgroup_apply_control(struct cgroup *cgrp);
241 static void cgroup_finalize_control(struct cgroup *cgrp, int ret);
244 static int cgroup_destroy_locked(struct cgroup *cgrp);
245 static struct cgroup_subsys_state *css_create(struct cgroup *cgrp,
250 struct cgroup *cgrp, struct cftype cfts[],
316 bool cgroup_on_dfl(const struct cgroup *cgrp) in cgroup_on_dfl()
352 static bool cgroup_has_tasks(struct cgroup *cgrp) in cgroup_has_tasks()
357 bool cgroup_is_threaded(struct cgroup *cgrp) in cgroup_is_threaded()
363 static bool cgroup_is_mixable(struct cgroup *cgrp) in cgroup_is_mixable()
374 static bool cgroup_can_be_thread_root(struct cgroup *cgrp) in cgroup_can_be_thread_root()
396 bool cgroup_is_thread_root(struct cgroup *cgrp) in cgroup_is_thread_root()
418 static bool cgroup_is_valid_domain(struct cgroup *cgrp) in cgroup_is_valid_domain()
436 static u16 cgroup_control(struct cgroup *cgrp) in cgroup_control()
438 struct cgroup *parent = cgroup_parent(cgrp); in cgroup_control()
457 static u16 cgroup_ss_mask(struct cgroup *cgrp) in cgroup_ss_mask()
459 struct cgroup *parent = cgroup_parent(cgrp); in cgroup_ss_mask()
484 static struct cgroup_subsys_state *cgroup_css(struct cgroup *cgrp, in cgroup_css()
502 static struct cgroup_subsys_state *cgroup_tryget_css(struct cgroup *cgrp, in cgroup_tryget_css()
526 static struct cgroup_subsys_state *cgroup_e_css_by_mask(struct cgroup *cgrp, in cgroup_e_css_by_mask()
560 struct cgroup_subsys_state *cgroup_e_css(struct cgroup *cgrp, in cgroup_e_css()
590 struct cgroup_subsys_state *cgroup_get_e_css(struct cgroup *cgrp, in cgroup_get_e_css()
616 static void cgroup_get_live(struct cgroup *cgrp) in cgroup_get_live()
627 int __cgroup_task_count(const struct cgroup *cgrp) in __cgroup_task_count()
644 int cgroup_task_count(const struct cgroup *cgrp) in cgroup_task_count()
657 struct cgroup *cgrp = of->kn->parent->priv; in of_css()
741 (dsct) = (d_css)->cgroup; \
750 (dsct) = (d_css)->cgroup; \
824 static void cgroup_update_populated(struct cgroup *cgrp, bool populated) in cgroup_update_populated()
826 struct cgroup *child = NULL; in cgroup_update_populated()
1008 struct cgroup *new_cgrp, in compare_css_sets()
1011 struct cgroup *new_dfl_cgrp; in compare_css_sets()
1042 struct cgroup *cgrp1, *cgrp2; in compare_css_sets()
1086 struct cgroup *cgrp, in find_existing_css_set()
1172 struct cgroup *cgrp) in link_css_set()
1205 struct cgroup *cgrp) in find_css_set()
1258 struct cgroup *c = link->cgrp; in find_css_set()
1277 &css->cgroup->e_csets[ssid]); in find_css_set()
1310 struct cgroup *root_cgrp = kf_root->kn->priv; in cgroup_root_from_kf()
1343 struct cgroup *cgrp = &root->cgrp; in cgroup_destroy_root()
1388 static struct cgroup *
1391 struct cgroup *res = NULL; in current_cgns_cgroup_from_root()
1407 struct cgroup *c = link->cgrp; in current_cgns_cgroup_from_root()
1422 static struct cgroup *cset_cgroup_from_root(struct css_set *cset, in cset_cgroup_from_root()
1425 struct cgroup *res = NULL; in cset_cgroup_from_root()
1438 struct cgroup *c = link->cgrp; in cset_cgroup_from_root()
1455 struct cgroup *task_cgroup_from_root(struct task_struct *task, in task_cgroup_from_root()
1493 static char *cgroup_file_name(struct cgroup *cgrp, const struct cftype *cft, in cgroup_file_name()
1590 struct cgroup *cgrp; in cgroup_kn_unlock()
1620 struct cgroup *cgroup_kn_lock_live(struct kernfs_node *kn, bool drain_offline) in cgroup_kn_lock_live()
1622 struct cgroup *cgrp; in cgroup_kn_lock_live()
1651 static void cgroup_rm_file(struct cgroup *cgrp, const struct cftype *cft) in cgroup_rm_file()
1677 struct cgroup *cgrp = css->cgroup; in css_clear_dir()
1706 struct cgroup *cgrp = css->cgroup; in css_populate_dir()
1746 struct cgroup *dcgrp = &dst_root->cgrp; in rebind_subsystems()
1777 struct cgroup *scgrp = &cgrp_dfl_root.cgrp; in rebind_subsystems()
1790 struct cgroup *scgrp = &src_root->cgrp; in rebind_subsystems()
1808 css->cgroup = dcgrp; in rebind_subsystems()
1864 struct cgroup *ns_cgroup; in cgroup_show_path()
1962 static void init_cgroup_housekeeping(struct cgroup *cgrp) in init_cgroup_housekeeping()
1972 cgrp->self.cgroup = cgrp; in init_cgroup_housekeeping()
1990 struct cgroup *cgrp = &root->cgrp; in init_cgroup_root()
2009 struct cgroup *root_cgrp = &root->cgrp; in cgroup_setup_root()
2128 struct cgroup *cgrp; in cgroup_do_get_tree()
2302 int cgroup_path_ns_locked(struct cgroup *cgrp, char *buf, size_t buflen, in cgroup_path_ns_locked()
2305 struct cgroup *root = cset_cgroup_from_root(ns->root_cset, cgrp->root); in cgroup_path_ns_locked()
2310 int cgroup_path_ns(struct cgroup *cgrp, char *buf, size_t buflen, in cgroup_path_ns()
2343 struct cgroup *cgrp; in task_cgroup_path()
2627 int cgroup_migrate_vet_dst(struct cgroup *dst_cgrp) in cgroup_migrate_vet_dst()
2708 struct cgroup *dst_cgrp, in cgroup_migrate_add_src()
2711 struct cgroup *src_cgrp; in cgroup_migrate_add_src()
2853 int cgroup_attach_task(struct cgroup *dst_cgrp, struct task_struct *leader, in cgroup_attach_task()
2887 struct cgroup *dst_cgrp) in cgroup_procs_write_start()
2981 struct cgroup *cgrp = seq_css(seq)->cgroup; in cgroup_controllers_show()
2990 struct cgroup *cgrp = seq_css(seq)->cgroup; in cgroup_subtree_control_show()
3005 static int cgroup_update_dfl_csses(struct cgroup *cgrp) in cgroup_update_dfl_csses()
3009 struct cgroup *dsct; in cgroup_update_dfl_csses()
3066 void cgroup_lock_and_drain_offline(struct cgroup *cgrp) in cgroup_lock_and_drain_offline()
3069 struct cgroup *dsct; in cgroup_lock_and_drain_offline()
3107 static void cgroup_save_control(struct cgroup *cgrp) in cgroup_save_control()
3109 struct cgroup *dsct; in cgroup_save_control()
3127 static void cgroup_propagate_control(struct cgroup *cgrp) in cgroup_propagate_control()
3129 struct cgroup *dsct; in cgroup_propagate_control()
3148 static void cgroup_restore_control(struct cgroup *cgrp) in cgroup_restore_control()
3150 struct cgroup *dsct; in cgroup_restore_control()
3163 struct cgroup *cgrp = css->cgroup; in css_visible()
3185 static int cgroup_apply_control_enable(struct cgroup *cgrp) in cgroup_apply_control_enable()
3187 struct cgroup *dsct; in cgroup_apply_control_enable()
3231 static void cgroup_apply_control_disable(struct cgroup *cgrp) in cgroup_apply_control_disable()
3233 struct cgroup *dsct; in cgroup_apply_control_disable()
3276 static int cgroup_apply_control(struct cgroup *cgrp) in cgroup_apply_control()
3305 static void cgroup_finalize_control(struct cgroup *cgrp, int ret) in cgroup_finalize_control()
3315 static int cgroup_vet_subtree_control_enable(struct cgroup *cgrp, u16 enable) in cgroup_vet_subtree_control_enable()
3361 struct cgroup *cgrp, *child; in cgroup_subtree_control_write()
3460 static int cgroup_enable_threaded(struct cgroup *cgrp) in cgroup_enable_threaded()
3462 struct cgroup *parent = cgroup_parent(cgrp); in cgroup_enable_threaded()
3463 struct cgroup *dom_cgrp = parent->dom_cgrp; in cgroup_enable_threaded()
3464 struct cgroup *dsct; in cgroup_enable_threaded()
3509 struct cgroup *cgrp = seq_css(seq)->cgroup; in cgroup_type_show()
3526 struct cgroup *cgrp; in cgroup_type_write()
3547 struct cgroup *cgrp = seq_css(seq)->cgroup; in cgroup_max_descendants_show()
3561 struct cgroup *cgrp; in cgroup_max_descendants_write()
3590 struct cgroup *cgrp = seq_css(seq)->cgroup; in cgroup_max_depth_show()
3604 struct cgroup *cgrp; in cgroup_max_depth_write()
3633 struct cgroup *cgrp = seq_css(seq)->cgroup; in cgroup_events_show()
3643 struct cgroup *cgroup = seq_css(seq)->cgroup; in cgroup_stat_show() local
3646 cgroup->nr_descendants); in cgroup_stat_show()
3648 cgroup->nr_dying_descendants); in cgroup_stat_show()
3654 struct cgroup *cgrp, int ssid) in cgroup_extra_stat_show()
3674 struct cgroup __maybe_unused *cgrp = seq_css(seq)->cgroup; in cpu_stat_show()
3687 struct cgroup *cgrp = seq_css(seq)->cgroup; in cgroup_io_pressure_show()
3694 struct cgroup *cgrp = seq_css(seq)->cgroup; in cgroup_memory_pressure_show()
3701 struct cgroup *cgrp = seq_css(seq)->cgroup; in cgroup_cpu_pressure_show()
3712 struct cgroup *cgrp; in cgroup_pressure_write()
3792 struct cgroup *cgrp = seq_css(seq)->cgroup; in cgroup_freeze_show()
3802 struct cgroup *cgrp; in cgroup_freeze_write()
3824 static void __cgroup_kill(struct cgroup *cgrp) in __cgroup_kill()
3854 static void cgroup_kill(struct cgroup *cgrp) in cgroup_kill()
3857 struct cgroup *dsct; in cgroup_kill()
3870 struct cgroup *cgrp; in cgroup_kill_write()
3938 struct cgroup *cgrp = of->kn->parent->priv; in cgroup_file_write()
4071 static int cgroup_add_file(struct cgroup_subsys_state *css, struct cgroup *cgrp, in cgroup_add_file()
4120 struct cgroup *cgrp, struct cftype cfts[], in cgroup_addrm_files()
4162 struct cgroup *root = &ss->root->cgrp; in cgroup_apply_cftypes()
4170 struct cgroup *cgrp = css->cgroup; in cgroup_apply_cftypes()
4795 it->cset_pos = &css->cgroup->e_csets[css->ss->id]; in css_task_iter_start()
4797 it->cset_pos = &css->cgroup->cset_links; in css_task_iter_start()
4884 struct cgroup *cgrp = seq_css(s)->cgroup; in __cgroup_procs_start()
4908 struct cgroup *cgrp = seq_css(s)->cgroup; in cgroup_procs_start()
4929 static int cgroup_may_write(const struct cgroup *cgrp, struct super_block *sb) in cgroup_may_write()
4945 static int cgroup_procs_write_permission(struct cgroup *src_cgrp, in cgroup_procs_write_permission()
4946 struct cgroup *dst_cgrp, in cgroup_procs_write_permission()
4950 struct cgroup *com_cgrp = src_cgrp; in cgroup_procs_write_permission()
4976 static int cgroup_attach_permissions(struct cgroup *src_cgrp, in cgroup_attach_permissions()
4977 struct cgroup *dst_cgrp, in cgroup_attach_permissions()
5001 struct cgroup *src_cgrp, *dst_cgrp; in __cgroup_procs_write()
5072 .file_offset = offsetof(struct cgroup, procs_file),
5101 .file_offset = offsetof(struct cgroup, events_file),
5189 struct cgroup *cgrp = css->cgroup; in css_free_rwork_fn()
5238 struct cgroup *cgrp = css->cgroup; in css_release_work_fn()
5256 struct cgroup *tcgrp; in css_release_work_fn()
5297 struct cgroup_subsys *ss, struct cgroup *cgrp) in init_and_link_css()
5304 css->cgroup = cgrp; in init_and_link_css()
5336 rcu_assign_pointer(css->cgroup->subsys[ss->id], css); in online_css()
5359 RCU_INIT_POINTER(css->cgroup->subsys[ss->id], NULL); in offline_css()
5361 wake_up_all(&css->cgroup->offline_waitq); in offline_css()
5373 static struct cgroup_subsys_state *css_create(struct cgroup *cgrp, in css_create()
5376 struct cgroup *parent = cgroup_parent(cgrp); in css_create()
5424 static struct cgroup *cgroup_create(struct cgroup *parent, const char *name, in cgroup_create()
5428 struct cgroup *cgrp, *tcgrp; in cgroup_create()
5540 static bool cgroup_check_hierarchy_limits(struct cgroup *parent) in cgroup_check_hierarchy_limits()
5542 struct cgroup *cgroup; in cgroup_check_hierarchy_limits() local
5548 for (cgroup = parent; cgroup; cgroup = cgroup_parent(cgroup)) { in cgroup_check_hierarchy_limits()
5549 if (cgroup->nr_descendants >= cgroup->max_descendants) in cgroup_check_hierarchy_limits()
5552 if (level > cgroup->max_depth) in cgroup_check_hierarchy_limits()
5565 struct cgroup *parent, *cgrp; in cgroup_mkdir()
5721 static int cgroup_destroy_locked(struct cgroup *cgrp) in cgroup_destroy_locked()
5724 struct cgroup *tcgrp, *parent = cgroup_parent(cgrp); in cgroup_destroy_locked()
5795 struct cgroup *cgrp; in cgroup_rmdir()
6048 struct cgroup *cgroup_get_from_id(u64 id) in cgroup_get_from_id()
6051 struct cgroup *cgrp = NULL; in cgroup_get_from_id()
6096 struct cgroup *cgrp; in proc_cgroup_show()
6165 static struct cgroup *cgroup_get_from_file(struct file *f) in cgroup_get_from_file()
6168 struct cgroup *cgrp; in cgroup_get_from_file()
6174 cgrp = css->cgroup; in cgroup_get_from_file()
6203 struct cgroup *dst_cgrp = NULL; in cgroup_css_set_fork()
6223 f = fget_raw(kargs->cgroup); in cgroup_css_set_fork()
6291 struct cgroup *cgrp = kargs->cgrp; in cgroup_css_set_put_fork()
6580 struct cgroup *cgrp; in css_tryget_online_from_dir()
6628 struct cgroup *cgroup_get_from_path(const char *path) in cgroup_get_from_path()
6631 struct cgroup *cgrp = ERR_PTR(-ENOENT); in cgroup_get_from_path()
6632 struct cgroup *root_cgrp; in cgroup_get_from_path()
6670 struct cgroup *cgroup_get_from_fd(int fd) in cgroup_get_from_fd()
6672 struct cgroup *cgrp; in cgroup_get_from_fd()
6735 struct cgroup *cgroup; in cgroup_sk_alloc() local
6740 cgroup = &cgrp_dfl_root.cgrp; in cgroup_sk_alloc()
6741 cgroup_get(cgroup); in cgroup_sk_alloc()
6750 cgroup = cset->dfl_cgrp; in cgroup_sk_alloc()
6756 skcd->cgroup = cgroup; in cgroup_sk_alloc()
6757 cgroup_bpf_get(cgroup); in cgroup_sk_alloc()
6763 struct cgroup *cgrp = sock_cgroup_ptr(skcd); in cgroup_sk_clone()
6776 struct cgroup *cgrp = sock_cgroup_ptr(skcd); in cgroup_sk_free()
6785 int cgroup_bpf_attach(struct cgroup *cgrp, in cgroup_bpf_attach()
6799 int cgroup_bpf_detach(struct cgroup *cgrp, struct bpf_prog *prog, in cgroup_bpf_detach()
6810 int cgroup_bpf_query(struct cgroup *cgrp, const union bpf_attr *attr, in cgroup_bpf_query()