Lines Matching refs:cgroup
248 static int cgroup_apply_control(struct cgroup *cgrp);
249 static void cgroup_finalize_control(struct cgroup *cgrp, int ret);
252 static int cgroup_destroy_locked(struct cgroup *cgrp);
253 static struct cgroup_subsys_state *css_create(struct cgroup *cgrp,
258 struct cgroup *cgrp, struct cftype cfts[],
326 bool cgroup_on_dfl(const struct cgroup *cgrp) in cgroup_on_dfl()
362 static bool cgroup_has_tasks(struct cgroup *cgrp) in cgroup_has_tasks()
367 static bool cgroup_is_threaded(struct cgroup *cgrp) in cgroup_is_threaded()
373 static bool cgroup_is_mixable(struct cgroup *cgrp) in cgroup_is_mixable()
384 static bool cgroup_can_be_thread_root(struct cgroup *cgrp) in cgroup_can_be_thread_root()
406 static bool cgroup_is_thread_root(struct cgroup *cgrp) in cgroup_is_thread_root()
428 static bool cgroup_is_valid_domain(struct cgroup *cgrp) in cgroup_is_valid_domain()
446 static u16 cgroup_control(struct cgroup *cgrp) in cgroup_control()
448 struct cgroup *parent = cgroup_parent(cgrp); in cgroup_control()
467 static u16 cgroup_ss_mask(struct cgroup *cgrp) in cgroup_ss_mask()
469 struct cgroup *parent = cgroup_parent(cgrp); in cgroup_ss_mask()
494 static struct cgroup_subsys_state *cgroup_css(struct cgroup *cgrp, in cgroup_css()
514 static struct cgroup_subsys_state *cgroup_e_css_by_mask(struct cgroup *cgrp, in cgroup_e_css_by_mask()
548 struct cgroup_subsys_state *cgroup_e_css(struct cgroup *cgrp, in cgroup_e_css()
578 struct cgroup_subsys_state *cgroup_get_e_css(struct cgroup *cgrp, in cgroup_get_e_css()
604 static void cgroup_get_live(struct cgroup *cgrp) in cgroup_get_live()
615 int __cgroup_task_count(const struct cgroup *cgrp) in __cgroup_task_count()
632 int cgroup_task_count(const struct cgroup *cgrp) in cgroup_task_count()
643 static struct cgroup *kn_priv(struct kernfs_node *kn) in kn_priv()
658 struct cgroup *cgrp = kn_priv(of->kn); in of_css()
727 (dsct) = (d_css)->cgroup; \
736 (dsct) = (d_css)->cgroup; \
810 static void cgroup_update_populated(struct cgroup *cgrp, bool populated) in cgroup_update_populated()
812 struct cgroup *child = NULL; in cgroup_update_populated()
994 struct cgroup *new_cgrp, in compare_css_sets()
997 struct cgroup *new_dfl_cgrp; in compare_css_sets()
1028 struct cgroup *cgrp1, *cgrp2; in compare_css_sets()
1072 struct cgroup *cgrp, in find_existing_css_set()
1158 struct cgroup *cgrp) in link_css_set()
1191 struct cgroup *cgrp) in find_css_set()
1244 struct cgroup *c = link->cgrp; in find_css_set()
1263 &css->cgroup->e_csets[ssid]); in find_css_set()
1296 struct cgroup *root_cgrp = kernfs_root_to_node(kf_root)->priv; in cgroup_root_from_kf()
1343 struct cgroup *cgrp = &root->cgrp; in cgroup_destroy_root()
1393 static inline struct cgroup *__cset_cgroup_from_root(struct css_set *cset, in __cset_cgroup_from_root()
1396 struct cgroup *res_cgroup = NULL; in __cset_cgroup_from_root()
1407 struct cgroup *c = link->cgrp; in __cset_cgroup_from_root()
1432 static struct cgroup *
1435 struct cgroup *res = NULL; in current_cgns_cgroup_from_root()
1466 static struct cgroup *current_cgns_cgroup_dfl(void) in current_cgns_cgroup_dfl()
1485 static struct cgroup *cset_cgroup_from_root(struct css_set *cset, in cset_cgroup_from_root()
1499 struct cgroup *task_cgroup_from_root(struct task_struct *task, in task_cgroup_from_root()
1537 static char *cgroup_file_name(struct cgroup *cgrp, const struct cftype *cft, in cgroup_file_name()
1634 struct cgroup *cgrp; in cgroup_kn_unlock()
1664 struct cgroup *cgroup_kn_lock_live(struct kernfs_node *kn, bool drain_offline) in cgroup_kn_lock_live()
1666 struct cgroup *cgrp; in cgroup_kn_lock_live()
1695 static void cgroup_rm_file(struct cgroup *cgrp, const struct cftype *cft) in cgroup_rm_file()
1721 struct cgroup *cgrp = css->cgroup; in css_clear_dir()
1754 struct cgroup *cgrp = css->cgroup; in css_populate_dir()
1807 struct cgroup *dcgrp = &dst_root->cgrp; in rebind_subsystems()
1838 struct cgroup *scgrp = &cgrp_dfl_root.cgrp; in rebind_subsystems()
1851 struct cgroup *scgrp = &src_root->cgrp; in rebind_subsystems()
1871 css->cgroup = dcgrp; in rebind_subsystems()
1918 struct cgroup *ns_cgroup; in cgroup_show_path()
2057 static void init_cgroup_housekeeping(struct cgroup *cgrp) in init_cgroup_housekeeping()
2067 cgrp->self.cgroup = cgrp; in init_cgroup_housekeeping()
2089 struct cgroup *cgrp = &root->cgrp; in init_cgroup_root()
2109 struct cgroup *root_cgrp = &root->cgrp; in cgroup_setup_root()
2230 struct cgroup *cgrp; in cgroup_do_get_tree()
2435 int cgroup_path_ns_locked(struct cgroup *cgrp, char *buf, size_t buflen, in cgroup_path_ns_locked()
2438 struct cgroup *root = cset_cgroup_from_root(ns->root_cset, cgrp->root); in cgroup_path_ns_locked()
2443 int cgroup_path_ns(struct cgroup *cgrp, char *buf, size_t buflen, in cgroup_path_ns()
2718 int cgroup_migrate_vet_dst(struct cgroup *dst_cgrp) in cgroup_migrate_vet_dst()
2795 struct cgroup *dst_cgrp, in cgroup_migrate_add_src()
2798 struct cgroup *src_cgrp; in cgroup_migrate_add_src()
2938 int cgroup_attach_task(struct cgroup *dst_cgrp, struct task_struct *leader, in cgroup_attach_task()
3061 struct cgroup *cgrp = seq_css(seq)->cgroup; in cgroup_controllers_show()
3070 struct cgroup *cgrp = seq_css(seq)->cgroup; in cgroup_subtree_control_show()
3085 static int cgroup_update_dfl_csses(struct cgroup *cgrp) in cgroup_update_dfl_csses()
3089 struct cgroup *dsct; in cgroup_update_dfl_csses()
3155 void cgroup_lock_and_drain_offline(struct cgroup *cgrp) in cgroup_lock_and_drain_offline()
3158 struct cgroup *dsct; in cgroup_lock_and_drain_offline()
3196 static void cgroup_save_control(struct cgroup *cgrp) in cgroup_save_control()
3198 struct cgroup *dsct; in cgroup_save_control()
3216 static void cgroup_propagate_control(struct cgroup *cgrp) in cgroup_propagate_control()
3218 struct cgroup *dsct; in cgroup_propagate_control()
3237 static void cgroup_restore_control(struct cgroup *cgrp) in cgroup_restore_control()
3239 struct cgroup *dsct; in cgroup_restore_control()
3252 struct cgroup *cgrp = css->cgroup; in css_visible()
3274 static int cgroup_apply_control_enable(struct cgroup *cgrp) in cgroup_apply_control_enable()
3276 struct cgroup *dsct; in cgroup_apply_control_enable()
3320 static void cgroup_apply_control_disable(struct cgroup *cgrp) in cgroup_apply_control_disable()
3322 struct cgroup *dsct; in cgroup_apply_control_disable()
3365 static int cgroup_apply_control(struct cgroup *cgrp) in cgroup_apply_control()
3390 static void cgroup_finalize_control(struct cgroup *cgrp, int ret) in cgroup_finalize_control()
3400 static int cgroup_vet_subtree_control_enable(struct cgroup *cgrp, u16 enable) in cgroup_vet_subtree_control_enable()
3446 struct cgroup *cgrp, *child; in cgroup_subtree_control_write()
3545 static int cgroup_enable_threaded(struct cgroup *cgrp) in cgroup_enable_threaded()
3547 struct cgroup *parent = cgroup_parent(cgrp); in cgroup_enable_threaded()
3548 struct cgroup *dom_cgrp = parent->dom_cgrp; in cgroup_enable_threaded()
3549 struct cgroup *dsct; in cgroup_enable_threaded()
3594 struct cgroup *cgrp = seq_css(seq)->cgroup; in cgroup_type_show()
3611 struct cgroup *cgrp; in cgroup_type_write()
3632 struct cgroup *cgrp = seq_css(seq)->cgroup; in cgroup_max_descendants_show()
3646 struct cgroup *cgrp; in cgroup_max_descendants_write()
3675 struct cgroup *cgrp = seq_css(seq)->cgroup; in cgroup_max_depth_show()
3689 struct cgroup *cgrp; in cgroup_max_depth_write()
3718 struct cgroup *cgrp = seq_css(seq)->cgroup; in cgroup_events_show()
3728 struct cgroup *cgroup = seq_css(seq)->cgroup; in cgroup_stat_show() local
3734 cgroup->nr_descendants); in cgroup_stat_show()
3749 css = rcu_dereference_raw(cgroup->subsys[ssid]); in cgroup_stat_show()
3750 dying_cnt[ssid] = cgroup->nr_dying_subsys[ssid]; in cgroup_stat_show()
3756 cgroup->nr_dying_descendants); in cgroup_stat_show()
3775 static struct cgroup_subsys_state *cgroup_tryget_css(struct cgroup *cgrp, in cgroup_tryget_css()
3791 struct cgroup *cgrp = seq_css(seq)->cgroup; in cgroup_extra_stat_show()
3809 struct cgroup *cgrp, int ssid) in cgroup_local_stat_show()
3841 struct cgroup __maybe_unused *cgrp = seq_css(seq)->cgroup; in cpu_local_stat_show()
3853 struct cgroup *cgrp = seq_css(seq)->cgroup; in cgroup_io_pressure_show()
3860 struct cgroup *cgrp = seq_css(seq)->cgroup; in cgroup_memory_pressure_show()
3867 struct cgroup *cgrp = seq_css(seq)->cgroup; in cgroup_cpu_pressure_show()
3878 struct cgroup *cgrp; in pressure_write()
3931 struct cgroup *cgrp = seq_css(seq)->cgroup; in cgroup_irq_pressure_show()
3947 struct cgroup *cgrp = seq_css(seq)->cgroup; in cgroup_pressure_show()
3961 struct cgroup *cgrp; in cgroup_pressure_write()
4026 struct cgroup *cgrp = seq_css(seq)->cgroup; in cgroup_freeze_show()
4036 struct cgroup *cgrp; in cgroup_freeze_write()
4058 static void __cgroup_kill(struct cgroup *cgrp) in __cgroup_kill()
4084 static void cgroup_kill(struct cgroup *cgrp) in cgroup_kill()
4087 struct cgroup *dsct; in cgroup_kill()
4100 struct cgroup *cgrp; in cgroup_kill_write()
4168 struct cgroup *cgrp = kn_priv(of->kn); in cgroup_file_write()
4287 static int cgroup_add_file(struct cgroup_subsys_state *css, struct cgroup *cgrp, in cgroup_add_file()
4329 struct cgroup *cgrp, struct cftype cfts[], in cgroup_addrm_files()
4369 struct cgroup *root = &ss->root->cgrp; in cgroup_apply_cftypes()
4377 struct cgroup *cgrp = css->cgroup; in cgroup_apply_cftypes()
5030 it->cset_pos = &css->cgroup->e_csets[css->ss->id]; in css_task_iter_start()
5032 it->cset_pos = &css->cgroup->cset_links; in css_task_iter_start()
5123 struct cgroup *cgrp = seq_css(s)->cgroup; in __cgroup_procs_start()
5147 struct cgroup *cgrp = seq_css(s)->cgroup; in cgroup_procs_start()
5168 static int cgroup_may_write(const struct cgroup *cgrp, struct super_block *sb) in cgroup_may_write()
5184 static int cgroup_procs_write_permission(struct cgroup *src_cgrp, in cgroup_procs_write_permission()
5185 struct cgroup *dst_cgrp, in cgroup_procs_write_permission()
5189 struct cgroup *com_cgrp = src_cgrp; in cgroup_procs_write_permission()
5215 static int cgroup_attach_permissions(struct cgroup *src_cgrp, in cgroup_attach_permissions()
5216 struct cgroup *dst_cgrp, in cgroup_attach_permissions()
5240 struct cgroup *src_cgrp, *dst_cgrp; in __cgroup_procs_write()
5311 .file_offset = offsetof(struct cgroup, procs_file),
5340 .file_offset = offsetof(struct cgroup, events_file),
5383 .file_offset = offsetof(struct cgroup, psi_files[PSI_IO]),
5391 .file_offset = offsetof(struct cgroup, psi_files[PSI_MEM]),
5399 .file_offset = offsetof(struct cgroup, psi_files[PSI_CPU]),
5408 .file_offset = offsetof(struct cgroup, psi_files[PSI_IRQ]),
5451 struct cgroup *cgrp = css->cgroup; in css_free_rwork_fn()
5502 struct cgroup *cgrp = css->cgroup; in css_release_work_fn()
5510 struct cgroup *parent_cgrp; in css_release_work_fn()
5533 struct cgroup *tcgrp; in css_release_work_fn()
5574 struct cgroup_subsys *ss, struct cgroup *cgrp) in init_and_link_css()
5581 css->cgroup = cgrp; in init_and_link_css()
5609 rcu_assign_pointer(css->cgroup->subsys[ss->id], css); in online_css()
5635 RCU_INIT_POINTER(css->cgroup->subsys[ss->id], NULL); in offline_css()
5637 wake_up_all(&css->cgroup->offline_waitq); in offline_css()
5639 css->cgroup->nr_dying_subsys[ss->id]++; in offline_css()
5646 css->cgroup->nr_dying_subsys[ss->id]++; in offline_css()
5659 static struct cgroup_subsys_state *css_create(struct cgroup *cgrp, in css_create()
5662 struct cgroup *parent = cgroup_parent(cgrp); in css_create()
5712 static struct cgroup *cgroup_create(struct cgroup *parent, const char *name, in cgroup_create()
5716 struct cgroup *cgrp, *tcgrp; in cgroup_create()
5836 static bool cgroup_check_hierarchy_limits(struct cgroup *parent) in cgroup_check_hierarchy_limits()
5838 struct cgroup *cgroup; in cgroup_check_hierarchy_limits() local
5844 for (cgroup = parent; cgroup; cgroup = cgroup_parent(cgroup)) { in cgroup_check_hierarchy_limits()
5845 if (cgroup->nr_descendants >= cgroup->max_descendants) in cgroup_check_hierarchy_limits()
5848 if (level >= cgroup->max_depth) in cgroup_check_hierarchy_limits()
5861 struct cgroup *parent, *cgrp; in cgroup_mkdir()
6019 static int cgroup_destroy_locked(struct cgroup *cgrp) in cgroup_destroy_locked()
6022 struct cgroup *tcgrp, *parent = cgroup_parent(cgrp); in cgroup_destroy_locked()
6095 struct cgroup *cgrp; in cgroup_rmdir()
6351 struct cgroup *cgroup_get_from_id(u64 id) in cgroup_get_from_id()
6354 struct cgroup *cgrp, *root_cgrp; in cgroup_get_from_id()
6409 struct cgroup *cgrp; in proc_cgroup_show()
6488 static struct cgroup *cgroup_v1v2_get_from_file(struct file *f) in cgroup_v1v2_get_from_file()
6496 return css->cgroup; in cgroup_v1v2_get_from_file()
6504 static struct cgroup *cgroup_get_from_file(struct file *f) in cgroup_get_from_file()
6506 struct cgroup *cgrp = cgroup_v1v2_get_from_file(f); in cgroup_get_from_file()
6539 struct cgroup *dst_cgrp = NULL; in cgroup_css_set_fork()
6562 CLASS(fd_raw, f)(kargs->cgroup); in cgroup_css_set_fork()
6641 struct cgroup *cgrp = kargs->cgrp; in cgroup_css_set_put_fork()
6946 struct cgroup *cgrp; in css_tryget_online_from_dir()
6994 struct cgroup *cgroup_get_from_path(const char *path) in cgroup_get_from_path()
6997 struct cgroup *cgrp = ERR_PTR(-ENOENT); in cgroup_get_from_path()
6998 struct cgroup *root_cgrp; in cgroup_get_from_path()
7034 struct cgroup *cgroup_v1v2_get_from_fd(int fd) in cgroup_v1v2_get_from_fd()
7048 struct cgroup *cgroup_get_from_fd(int fd) in cgroup_get_from_fd()
7050 struct cgroup *cgrp = cgroup_v1v2_get_from_fd(fd); in cgroup_get_from_fd()
7113 struct cgroup *cgroup; in cgroup_sk_alloc() local
7118 cgroup = &cgrp_dfl_root.cgrp; in cgroup_sk_alloc()
7119 cgroup_get(cgroup); in cgroup_sk_alloc()
7128 cgroup = cset->dfl_cgrp; in cgroup_sk_alloc()
7134 skcd->cgroup = cgroup; in cgroup_sk_alloc()
7135 cgroup_bpf_get(cgroup); in cgroup_sk_alloc()
7141 struct cgroup *cgrp = sock_cgroup_ptr(skcd); in cgroup_sk_clone()
7154 struct cgroup *cgrp = sock_cgroup_ptr(skcd); in cgroup_sk_free()