Lines Matching refs:cgroup

236 static int cgroup_apply_control(struct cgroup *cgrp);
237 static void cgroup_finalize_control(struct cgroup *cgrp, int ret);
240 static int cgroup_destroy_locked(struct cgroup *cgrp);
241 static struct cgroup_subsys_state *css_create(struct cgroup *cgrp,
246 struct cgroup *cgrp, struct cftype cfts[],
312 bool cgroup_on_dfl(const struct cgroup *cgrp) in cgroup_on_dfl()
348 static bool cgroup_has_tasks(struct cgroup *cgrp) in cgroup_has_tasks()
353 bool cgroup_is_threaded(struct cgroup *cgrp) in cgroup_is_threaded()
359 static bool cgroup_is_mixable(struct cgroup *cgrp) in cgroup_is_mixable()
370 static bool cgroup_can_be_thread_root(struct cgroup *cgrp) in cgroup_can_be_thread_root()
392 bool cgroup_is_thread_root(struct cgroup *cgrp) in cgroup_is_thread_root()
414 static bool cgroup_is_valid_domain(struct cgroup *cgrp) in cgroup_is_valid_domain()
432 static u16 cgroup_control(struct cgroup *cgrp) in cgroup_control()
434 struct cgroup *parent = cgroup_parent(cgrp); in cgroup_control()
453 static u16 cgroup_ss_mask(struct cgroup *cgrp) in cgroup_ss_mask()
455 struct cgroup *parent = cgroup_parent(cgrp); in cgroup_ss_mask()
480 static struct cgroup_subsys_state *cgroup_css(struct cgroup *cgrp, in cgroup_css()
498 static struct cgroup_subsys_state *cgroup_tryget_css(struct cgroup *cgrp, in cgroup_tryget_css()
522 static struct cgroup_subsys_state *cgroup_e_css_by_mask(struct cgroup *cgrp, in cgroup_e_css_by_mask()
556 struct cgroup_subsys_state *cgroup_e_css(struct cgroup *cgrp, in cgroup_e_css()
586 struct cgroup_subsys_state *cgroup_get_e_css(struct cgroup *cgrp, in cgroup_get_e_css()
612 static void cgroup_get_live(struct cgroup *cgrp) in cgroup_get_live()
623 int __cgroup_task_count(const struct cgroup *cgrp) in __cgroup_task_count()
640 int cgroup_task_count(const struct cgroup *cgrp) in cgroup_task_count()
653 struct cgroup *cgrp = of->kn->parent->priv; in of_css()
737 (dsct) = (d_css)->cgroup; \
746 (dsct) = (d_css)->cgroup; \
819 static void cgroup_update_populated(struct cgroup *cgrp, bool populated) in cgroup_update_populated()
821 struct cgroup *child = NULL; in cgroup_update_populated()
1003 struct cgroup *new_cgrp, in compare_css_sets()
1006 struct cgroup *new_dfl_cgrp; in compare_css_sets()
1037 struct cgroup *cgrp1, *cgrp2; in compare_css_sets()
1081 struct cgroup *cgrp, in find_existing_css_set()
1167 struct cgroup *cgrp) in link_css_set()
1200 struct cgroup *cgrp) in find_css_set()
1252 struct cgroup *c = link->cgrp; in find_css_set()
1271 &css->cgroup->e_csets[ssid]); in find_css_set()
1304 struct cgroup *root_cgrp = kf_root->kn->priv; in cgroup_root_from_kf()
1337 struct cgroup *cgrp = &root->cgrp; in cgroup_destroy_root()
1382 static struct cgroup *
1385 struct cgroup *res = NULL; in current_cgns_cgroup_from_root()
1401 struct cgroup *c = link->cgrp; in current_cgns_cgroup_from_root()
1416 static struct cgroup *cset_cgroup_from_root(struct css_set *cset, in cset_cgroup_from_root()
1419 struct cgroup *res = NULL; in cset_cgroup_from_root()
1432 struct cgroup *c = link->cgrp; in cset_cgroup_from_root()
1449 struct cgroup *task_cgroup_from_root(struct task_struct *task, in task_cgroup_from_root()
1487 static char *cgroup_file_name(struct cgroup *cgrp, const struct cftype *cft, in cgroup_file_name()
1584 struct cgroup *cgrp; in cgroup_kn_unlock()
1614 struct cgroup *cgroup_kn_lock_live(struct kernfs_node *kn, bool drain_offline) in cgroup_kn_lock_live()
1616 struct cgroup *cgrp; in cgroup_kn_lock_live()
1645 static void cgroup_rm_file(struct cgroup *cgrp, const struct cftype *cft) in cgroup_rm_file()
1671 struct cgroup *cgrp = css->cgroup; in css_clear_dir()
1700 struct cgroup *cgrp = css->cgroup; in css_populate_dir()
1740 struct cgroup *dcgrp = &dst_root->cgrp; in rebind_subsystems()
1771 struct cgroup *scgrp = &cgrp_dfl_root.cgrp; in rebind_subsystems()
1784 struct cgroup *scgrp = &src_root->cgrp; in rebind_subsystems()
1801 css->cgroup = dcgrp; in rebind_subsystems()
1843 struct cgroup *ns_cgroup; in cgroup_show_path()
1941 static void init_cgroup_housekeeping(struct cgroup *cgrp) in init_cgroup_housekeeping()
1951 cgrp->self.cgroup = cgrp; in init_cgroup_housekeeping()
1969 struct cgroup *cgrp = &root->cgrp; in init_cgroup_root()
1988 struct cgroup *root_cgrp = &root->cgrp; in cgroup_setup_root()
2107 struct cgroup *cgrp; in cgroup_do_get_tree()
2281 int cgroup_path_ns_locked(struct cgroup *cgrp, char *buf, size_t buflen, in cgroup_path_ns_locked()
2284 struct cgroup *root = cset_cgroup_from_root(ns->root_cset, cgrp->root); in cgroup_path_ns_locked()
2289 int cgroup_path_ns(struct cgroup *cgrp, char *buf, size_t buflen, in cgroup_path_ns()
2322 struct cgroup *cgrp; in task_cgroup_path()
2562 int cgroup_migrate_vet_dst(struct cgroup *dst_cgrp) in cgroup_migrate_vet_dst()
2637 struct cgroup *dst_cgrp, in cgroup_migrate_add_src()
2640 struct cgroup *src_cgrp; in cgroup_migrate_add_src()
2782 int cgroup_attach_task(struct cgroup *dst_cgrp, struct task_struct *leader, in cgroup_attach_task()
2913 struct cgroup *cgrp = seq_css(seq)->cgroup; in cgroup_controllers_show()
2922 struct cgroup *cgrp = seq_css(seq)->cgroup; in cgroup_subtree_control_show()
2937 static int cgroup_update_dfl_csses(struct cgroup *cgrp) in cgroup_update_dfl_csses()
2941 struct cgroup *dsct; in cgroup_update_dfl_csses()
2989 void cgroup_lock_and_drain_offline(struct cgroup *cgrp) in cgroup_lock_and_drain_offline()
2992 struct cgroup *dsct; in cgroup_lock_and_drain_offline()
3030 static void cgroup_save_control(struct cgroup *cgrp) in cgroup_save_control()
3032 struct cgroup *dsct; in cgroup_save_control()
3050 static void cgroup_propagate_control(struct cgroup *cgrp) in cgroup_propagate_control()
3052 struct cgroup *dsct; in cgroup_propagate_control()
3071 static void cgroup_restore_control(struct cgroup *cgrp) in cgroup_restore_control()
3073 struct cgroup *dsct; in cgroup_restore_control()
3086 struct cgroup *cgrp = css->cgroup; in css_visible()
3108 static int cgroup_apply_control_enable(struct cgroup *cgrp) in cgroup_apply_control_enable()
3110 struct cgroup *dsct; in cgroup_apply_control_enable()
3154 static void cgroup_apply_control_disable(struct cgroup *cgrp) in cgroup_apply_control_disable()
3156 struct cgroup *dsct; in cgroup_apply_control_disable()
3199 static int cgroup_apply_control(struct cgroup *cgrp) in cgroup_apply_control()
3228 static void cgroup_finalize_control(struct cgroup *cgrp, int ret) in cgroup_finalize_control()
3238 static int cgroup_vet_subtree_control_enable(struct cgroup *cgrp, u16 enable) in cgroup_vet_subtree_control_enable()
3284 struct cgroup *cgrp, *child; in cgroup_subtree_control_write()
3383 static int cgroup_enable_threaded(struct cgroup *cgrp) in cgroup_enable_threaded()
3385 struct cgroup *parent = cgroup_parent(cgrp); in cgroup_enable_threaded()
3386 struct cgroup *dom_cgrp = parent->dom_cgrp; in cgroup_enable_threaded()
3387 struct cgroup *dsct; in cgroup_enable_threaded()
3432 struct cgroup *cgrp = seq_css(seq)->cgroup; in cgroup_type_show()
3449 struct cgroup *cgrp; in cgroup_type_write()
3470 struct cgroup *cgrp = seq_css(seq)->cgroup; in cgroup_max_descendants_show()
3484 struct cgroup *cgrp; in cgroup_max_descendants_write()
3513 struct cgroup *cgrp = seq_css(seq)->cgroup; in cgroup_max_depth_show()
3527 struct cgroup *cgrp; in cgroup_max_depth_write()
3556 struct cgroup *cgrp = seq_css(seq)->cgroup; in cgroup_events_show()
3566 struct cgroup *cgroup = seq_css(seq)->cgroup; in cgroup_stat_show() local
3569 cgroup->nr_descendants); in cgroup_stat_show()
3571 cgroup->nr_dying_descendants); in cgroup_stat_show()
3577 struct cgroup *cgrp, int ssid) in cgroup_extra_stat_show()
3597 struct cgroup __maybe_unused *cgrp = seq_css(seq)->cgroup; in cpu_stat_show()
3610 struct cgroup *cgrp = seq_css(seq)->cgroup; in cgroup_io_pressure_show()
3617 struct cgroup *cgrp = seq_css(seq)->cgroup; in cgroup_memory_pressure_show()
3624 struct cgroup *cgrp = seq_css(seq)->cgroup; in cgroup_cpu_pressure_show()
3635 struct cgroup *cgrp; in cgroup_pressure_write()
3710 struct cgroup *cgrp = seq_css(seq)->cgroup; in cgroup_freeze_show()
3720 struct cgroup *cgrp; in cgroup_freeze_write()
3742 static void __cgroup_kill(struct cgroup *cgrp) in __cgroup_kill()
3772 static void cgroup_kill(struct cgroup *cgrp) in cgroup_kill()
3775 struct cgroup *dsct; in cgroup_kill()
3788 struct cgroup *cgrp; in cgroup_kill_write()
3856 struct cgroup *cgrp = of->kn->parent->priv; in cgroup_file_write()
3989 static int cgroup_add_file(struct cgroup_subsys_state *css, struct cgroup *cgrp, in cgroup_add_file()
4038 struct cgroup *cgrp, struct cftype cfts[], in cgroup_addrm_files()
4080 struct cgroup *root = &ss->root->cgrp; in cgroup_apply_cftypes()
4088 struct cgroup *cgrp = css->cgroup; in cgroup_apply_cftypes()
4710 it->cset_pos = &css->cgroup->e_csets[css->ss->id]; in css_task_iter_start()
4712 it->cset_pos = &css->cgroup->cset_links; in css_task_iter_start()
4799 struct cgroup *cgrp = seq_css(s)->cgroup; in __cgroup_procs_start()
4823 struct cgroup *cgrp = seq_css(s)->cgroup; in cgroup_procs_start()
4844 static int cgroup_may_write(const struct cgroup *cgrp, struct super_block *sb) in cgroup_may_write()
4860 static int cgroup_procs_write_permission(struct cgroup *src_cgrp, in cgroup_procs_write_permission()
4861 struct cgroup *dst_cgrp, in cgroup_procs_write_permission()
4865 struct cgroup *com_cgrp = src_cgrp; in cgroup_procs_write_permission()
4891 static int cgroup_attach_permissions(struct cgroup *src_cgrp, in cgroup_attach_permissions()
4892 struct cgroup *dst_cgrp, in cgroup_attach_permissions()
4916 struct cgroup *src_cgrp, *dst_cgrp; in __cgroup_procs_write()
4987 .file_offset = offsetof(struct cgroup, procs_file),
5016 .file_offset = offsetof(struct cgroup, events_file),
5104 struct cgroup *cgrp = css->cgroup; in css_free_rwork_fn()
5153 struct cgroup *cgrp = css->cgroup; in css_release_work_fn()
5171 struct cgroup *tcgrp; in css_release_work_fn()
5212 struct cgroup_subsys *ss, struct cgroup *cgrp) in init_and_link_css()
5219 css->cgroup = cgrp; in init_and_link_css()
5251 rcu_assign_pointer(css->cgroup->subsys[ss->id], css); in online_css()
5274 RCU_INIT_POINTER(css->cgroup->subsys[ss->id], NULL); in offline_css()
5276 wake_up_all(&css->cgroup->offline_waitq); in offline_css()
5288 static struct cgroup_subsys_state *css_create(struct cgroup *cgrp, in css_create()
5291 struct cgroup *parent = cgroup_parent(cgrp); in css_create()
5339 static struct cgroup *cgroup_create(struct cgroup *parent, const char *name, in cgroup_create()
5343 struct cgroup *cgrp, *tcgrp; in cgroup_create()
5455 static bool cgroup_check_hierarchy_limits(struct cgroup *parent) in cgroup_check_hierarchy_limits()
5457 struct cgroup *cgroup; in cgroup_check_hierarchy_limits() local
5463 for (cgroup = parent; cgroup; cgroup = cgroup_parent(cgroup)) { in cgroup_check_hierarchy_limits()
5464 if (cgroup->nr_descendants >= cgroup->max_descendants) in cgroup_check_hierarchy_limits()
5467 if (level > cgroup->max_depth) in cgroup_check_hierarchy_limits()
5480 struct cgroup *parent, *cgrp; in cgroup_mkdir()
5636 static int cgroup_destroy_locked(struct cgroup *cgrp) in cgroup_destroy_locked()
5639 struct cgroup *tcgrp, *parent = cgroup_parent(cgrp); in cgroup_destroy_locked()
5710 struct cgroup *cgrp; in cgroup_rmdir()
5963 struct cgroup *cgroup_get_from_id(u64 id) in cgroup_get_from_id()
5966 struct cgroup *cgrp = NULL; in cgroup_get_from_id()
6008 struct cgroup *cgrp; in proc_cgroup_show()
6077 static struct cgroup *cgroup_get_from_file(struct file *f) in cgroup_get_from_file()
6080 struct cgroup *cgrp; in cgroup_get_from_file()
6086 cgrp = css->cgroup; in cgroup_get_from_file()
6115 struct cgroup *dst_cgrp = NULL; in cgroup_css_set_fork()
6135 f = fget_raw(kargs->cgroup); in cgroup_css_set_fork()
6206 struct cgroup *cgrp = kargs->cgrp; in cgroup_css_set_put_fork()
6490 struct cgroup *cgrp; in css_tryget_online_from_dir()
6538 struct cgroup *cgroup_get_from_path(const char *path) in cgroup_get_from_path()
6541 struct cgroup *cgrp = ERR_PTR(-ENOENT); in cgroup_get_from_path()
6576 struct cgroup *cgroup_get_from_fd(int fd) in cgroup_get_from_fd()
6578 struct cgroup *cgrp; in cgroup_get_from_fd()
6641 struct cgroup *cgroup; in cgroup_sk_alloc() local
6646 cgroup = &cgrp_dfl_root.cgrp; in cgroup_sk_alloc()
6647 cgroup_get(cgroup); in cgroup_sk_alloc()
6656 cgroup = cset->dfl_cgrp; in cgroup_sk_alloc()
6662 skcd->cgroup = cgroup; in cgroup_sk_alloc()
6663 cgroup_bpf_get(cgroup); in cgroup_sk_alloc()
6669 struct cgroup *cgrp = sock_cgroup_ptr(skcd); in cgroup_sk_clone()
6682 struct cgroup *cgrp = sock_cgroup_ptr(skcd); in cgroup_sk_free()