Lines Matching refs:ss

242 					      struct cgroup_subsys *ss);
481 struct cgroup_subsys *ss) in cgroup_css() argument
483 if (CGROUP_HAS_SUBSYS_CONFIG && ss) in cgroup_css()
484 return rcu_dereference_check(cgrp->subsys[ss->id], in cgroup_css()
499 struct cgroup_subsys *ss) in cgroup_tryget_css() argument
504 css = cgroup_css(cgrp, ss); in cgroup_tryget_css()
523 struct cgroup_subsys *ss) in cgroup_e_css_by_mask() argument
527 if (!ss) in cgroup_e_css_by_mask()
534 while (!(cgroup_ss_mask(cgrp) & (1 << ss->id))) { in cgroup_e_css_by_mask()
540 return cgroup_css(cgrp, ss); in cgroup_e_css_by_mask()
557 struct cgroup_subsys *ss) in cgroup_e_css() argument
565 css = cgroup_css(cgrp, ss); in cgroup_e_css()
572 return init_css_set.subsys[ss->id]; in cgroup_e_css()
587 struct cgroup_subsys *ss) in cgroup_get_e_css() argument
597 css = cgroup_css(cgrp, ss); in cgroup_get_e_css()
604 css = init_css_set.subsys[ss->id]; in cgroup_get_e_css()
664 if (CGROUP_HAS_SUBSYS_CONFIG && cft->ss) in of_css()
665 return rcu_dereference_raw(cgrp->subsys[cft->ss->id]); in of_css()
710 #define do_each_subsys_mask(ss, ssid, ss_mask) do { \ argument
717 (ss) = cgroup_subsys[ssid]; \
944 struct cgroup_subsys *ss; in css_set_hash() local
947 for_each_subsys(ss, i) in css_set_hash()
957 struct cgroup_subsys *ss; in put_css_set_locked() local
968 for_each_subsys(ss, ssid) { in put_css_set_locked()
1085 struct cgroup_subsys *ss; in find_existing_css_set() local
1095 for_each_subsys(ss, i) { in find_existing_css_set()
1101 template[i] = cgroup_e_css_by_mask(cgrp, ss); in find_existing_css_set()
1206 struct cgroup_subsys *ss; in find_css_set() local
1267 for_each_subsys(ss, ssid) { in find_css_set()
1490 struct cgroup_subsys *ss = cft->ss; in cgroup_file_name() local
1492 if (cft->ss && !(cft->flags & CFTYPE_NO_PREFIX) && in cgroup_file_name()
1497 dbg, cgroup_on_dfl(cgrp) ? ss->name : ss->legacy_name, in cgroup_file_name()
1543 struct cgroup_subsys *ss; in cgroup_calc_subtree_ss_mask() local
1553 do_each_subsys_mask(ss, ssid, cur_ss_mask) { in cgroup_calc_subtree_ss_mask()
1554 new_ss_mask |= ss->depends_on; in cgroup_calc_subtree_ss_mask()
1652 struct cgroup_subsys_state *css = cgroup_css(cgrp, cft->ss); in cgroup_rm_file()
1679 if (!css->ss) { in css_clear_dir()
1687 list_for_each_entry(cfts, &css->ss->cfts, node) in css_clear_dir()
1707 if (!css->ss) { in css_populate_dir()
1717 list_for_each_entry(cfts, &css->ss->cfts, node) { in css_populate_dir()
1730 list_for_each_entry(cfts, &css->ss->cfts, node) { in css_populate_dir()
1741 struct cgroup_subsys *ss; in rebind_subsystems() local
1747 do_each_subsys_mask(ss, ssid, ss_mask) { in rebind_subsystems()
1753 if (css_next_child(NULL, cgroup_css(&ss->root->cgrp, ss)) && in rebind_subsystems()
1754 !ss->implicit_on_dfl) in rebind_subsystems()
1758 if (ss->root != &cgrp_dfl_root && dst_root != &cgrp_dfl_root) in rebind_subsystems()
1765 if (ss->root == &cgrp_dfl_root) in rebind_subsystems()
1782 do_each_subsys_mask(ss, ssid, ss_mask) { in rebind_subsystems()
1783 struct cgroup_root *src_root = ss->root; in rebind_subsystems()
1785 struct cgroup_subsys_state *css = cgroup_css(scgrp, ss); in rebind_subsystems()
1788 WARN_ON(!css || cgroup_css(dcgrp, ss)); in rebind_subsystems()
1800 ss->root = dst_root; in rebind_subsystems()
1805 list_move_tail(&cset->e_cset_node[ss->id], in rebind_subsystems()
1806 &dcgrp->e_csets[ss->id]); in rebind_subsystems()
1809 if (ss->css_rstat_flush) { in rebind_subsystems()
1827 ss->name, ret); in rebind_subsystems()
1829 if (ss->bind) in rebind_subsystems()
1830 ss->bind(css); in rebind_subsystems()
1943 struct cgroup_subsys *ss; in init_cgroup_housekeeping() local
1959 for_each_subsys(ss, ssid) in init_cgroup_housekeeping()
2458 struct cgroup_subsys *ss; in cgroup_migrate_execute() local
2465 do_each_subsys_mask(ss, ssid, mgctx->ss_mask) { in cgroup_migrate_execute()
2466 if (ss->can_attach) { in cgroup_migrate_execute()
2468 ret = ss->can_attach(tset); in cgroup_migrate_execute()
2512 do_each_subsys_mask(ss, ssid, mgctx->ss_mask) { in cgroup_migrate_execute()
2513 if (ss->attach) { in cgroup_migrate_execute()
2515 ss->attach(tset); in cgroup_migrate_execute()
2525 do_each_subsys_mask(ss, ssid, mgctx->ss_mask) { in cgroup_migrate_execute()
2528 if (ss->cancel_attach) { in cgroup_migrate_execute()
2530 ss->cancel_attach(tset); in cgroup_migrate_execute()
2693 struct cgroup_subsys *ss; in cgroup_migrate_prepare_dst() local
2724 for_each_subsys(ss, ssid) in cgroup_migrate_prepare_dst()
2881 struct cgroup_subsys *ss; in cgroup_procs_write_finish() local
2889 for_each_subsys(ss, ssid) in cgroup_procs_write_finish()
2890 if (ss->post_attach) in cgroup_procs_write_finish()
2891 ss->post_attach(); in cgroup_procs_write_finish()
2896 struct cgroup_subsys *ss; in cgroup_print_ss_mask() local
2900 do_each_subsys_mask(ss, ssid, ss_mask) { in cgroup_print_ss_mask()
2903 seq_puts(seq, ss->name); in cgroup_print_ss_mask()
2994 struct cgroup_subsys *ss; in cgroup_lock_and_drain_offline() local
3001 for_each_subsys(ss, ssid) { in cgroup_lock_and_drain_offline()
3002 struct cgroup_subsys_state *css = cgroup_css(dsct, ss); in cgroup_lock_and_drain_offline()
3085 struct cgroup_subsys *ss = css->ss; in css_visible() local
3088 if (cgroup_control(cgrp) & (1 << ss->id)) in css_visible()
3090 if (!(cgroup_ss_mask(cgrp) & (1 << ss->id))) in css_visible()
3092 return cgroup_on_dfl(cgrp) && ss->implicit_on_dfl; in css_visible()
3112 struct cgroup_subsys *ss; in cgroup_apply_control_enable() local
3116 for_each_subsys(ss, ssid) { in cgroup_apply_control_enable()
3117 struct cgroup_subsys_state *css = cgroup_css(dsct, ss); in cgroup_apply_control_enable()
3119 if (!(cgroup_ss_mask(dsct) & (1 << ss->id))) in cgroup_apply_control_enable()
3123 css = css_create(dsct, ss); in cgroup_apply_control_enable()
3158 struct cgroup_subsys *ss; in cgroup_apply_control_disable() local
3162 for_each_subsys(ss, ssid) { in cgroup_apply_control_disable()
3163 struct cgroup_subsys_state *css = cgroup_css(dsct, ss); in cgroup_apply_control_disable()
3171 !(cgroup_ss_mask(dsct) & (1 << ss->id))) { in cgroup_apply_control_disable()
3175 if (ss->css_reset) in cgroup_apply_control_disable()
3176 ss->css_reset(css); in cgroup_apply_control_disable()
3285 struct cgroup_subsys *ss; in cgroup_subtree_control_write() local
3297 do_each_subsys_mask(ss, ssid, ~cgrp_dfl_inhibit_ss_mask) { in cgroup_subtree_control_write()
3299 strcmp(tok + 1, ss->name)) in cgroup_subtree_control_write()
3321 for_each_subsys(ss, ssid) { in cgroup_subtree_control_write()
3579 struct cgroup_subsys *ss = cgroup_subsys[ssid]; in cgroup_extra_stat_show() local
3583 if (!ss->css_extra_stat_show) in cgroup_extra_stat_show()
3586 css = cgroup_tryget_css(cgrp, ss); in cgroup_extra_stat_show()
3590 ret = ss->css_extra_stat_show(seq, css); in cgroup_extra_stat_show()
3885 css = cgroup_css(cgrp, cft->ss); in cgroup_file_write()
4079 struct cgroup_subsys *ss = cfts[0].ss; in cgroup_apply_cftypes() local
4080 struct cgroup *root = &ss->root->cgrp; in cgroup_apply_cftypes()
4087 css_for_each_descendant_pre(css, cgroup_css(root, ss)) { in cgroup_apply_cftypes()
4112 cft->ss = NULL; in cgroup_exit_cftypes()
4119 static int cgroup_init_cftypes(struct cgroup_subsys *ss, struct cftype *cfts) in cgroup_init_cftypes() argument
4126 WARN_ON(cft->ss || cft->kf_ops); in cgroup_init_cftypes()
4150 cft->ss = ss; in cgroup_init_cftypes()
4160 if (!cfts || !cfts[0].ss) in cgroup_rm_cftypes_locked()
4204 static int cgroup_add_cftypes(struct cgroup_subsys *ss, struct cftype *cfts) in cgroup_add_cftypes() argument
4208 if (!cgroup_ssid_enabled(ss->id)) in cgroup_add_cftypes()
4214 ret = cgroup_init_cftypes(ss, cfts); in cgroup_add_cftypes()
4220 list_add_tail(&cfts->node, &ss->cfts); in cgroup_add_cftypes()
4237 int cgroup_add_dfl_cftypes(struct cgroup_subsys *ss, struct cftype *cfts) in cgroup_add_dfl_cftypes() argument
4243 return cgroup_add_cftypes(ss, cfts); in cgroup_add_dfl_cftypes()
4254 int cgroup_add_legacy_cftypes(struct cgroup_subsys *ss, struct cftype *cfts) in cgroup_add_legacy_cftypes() argument
4260 return cgroup_add_cftypes(ss, cfts); in cgroup_add_legacy_cftypes()
4546 if (it->ss) { in css_task_iter_next_css_set()
4547 cset = container_of(l, struct css_set, e_cset_node[it->ss->id]); in css_task_iter_next_css_set()
4706 it->ss = css->ss; in css_task_iter_start()
4709 if (CGROUP_HAS_SUBSYS_CONFIG && it->ss) in css_task_iter_start()
4710 it->cset_pos = &css->cgroup->e_csets[css->ss->id]; in css_task_iter_start()
5103 struct cgroup_subsys *ss = css->ss; in css_free_rwork_fn() local
5108 if (ss) { in css_free_rwork_fn()
5113 ss->css_free(css); in css_free_rwork_fn()
5114 cgroup_idr_remove(&ss->css_idr, id); in css_free_rwork_fn()
5152 struct cgroup_subsys *ss = css->ss; in css_release_work_fn() local
5160 if (ss) { in css_release_work_fn()
5167 cgroup_idr_replace(&ss->css_idr, NULL, css->id); in css_release_work_fn()
5168 if (ss->css_released) in css_release_work_fn()
5169 ss->css_released(css); in css_release_work_fn()
5212 struct cgroup_subsys *ss, struct cgroup *cgrp) in init_and_link_css() argument
5220 css->ss = ss; in init_and_link_css()
5229 css->parent = cgroup_css(cgroup_parent(cgrp), ss); in init_and_link_css()
5233 if (ss->css_rstat_flush) in init_and_link_css()
5236 BUG_ON(cgroup_css(cgrp, ss)); in init_and_link_css()
5242 struct cgroup_subsys *ss = css->ss; in online_css() local
5247 if (ss->css_online) in online_css()
5248 ret = ss->css_online(css); in online_css()
5251 rcu_assign_pointer(css->cgroup->subsys[ss->id], css); in online_css()
5263 struct cgroup_subsys *ss = css->ss; in offline_css() local
5270 if (ss->css_offline) in offline_css()
5271 ss->css_offline(css); in offline_css()
5274 RCU_INIT_POINTER(css->cgroup->subsys[ss->id], NULL); in offline_css()
5289 struct cgroup_subsys *ss) in css_create() argument
5292 struct cgroup_subsys_state *parent_css = cgroup_css(parent, ss); in css_create()
5298 css = ss->css_alloc(parent_css); in css_create()
5304 init_and_link_css(css, ss, cgrp); in css_create()
5310 err = cgroup_idr_alloc(&ss->css_idr, NULL, 2, 0, GFP_KERNEL); in css_create()
5317 cgroup_idr_replace(&ss->css_idr, css, css->id); in css_create()
5732 static void __init cgroup_init_subsys(struct cgroup_subsys *ss, bool early) in cgroup_init_subsys() argument
5736 pr_debug("Initializing cgroup subsys %s\n", ss->name); in cgroup_init_subsys()
5740 idr_init(&ss->css_idr); in cgroup_init_subsys()
5741 INIT_LIST_HEAD(&ss->cfts); in cgroup_init_subsys()
5744 ss->root = &cgrp_dfl_root; in cgroup_init_subsys()
5745 css = ss->css_alloc(cgroup_css(&cgrp_dfl_root.cgrp, ss)); in cgroup_init_subsys()
5748 init_and_link_css(css, ss, &cgrp_dfl_root.cgrp); in cgroup_init_subsys()
5760 css->id = cgroup_idr_alloc(&ss->css_idr, css, 1, 2, GFP_KERNEL); in cgroup_init_subsys()
5768 init_css_set.subsys[ss->id] = css; in cgroup_init_subsys()
5770 have_fork_callback |= (bool)ss->fork << ss->id; in cgroup_init_subsys()
5771 have_exit_callback |= (bool)ss->exit << ss->id; in cgroup_init_subsys()
5772 have_release_callback |= (bool)ss->release << ss->id; in cgroup_init_subsys()
5773 have_canfork_callback |= (bool)ss->can_fork << ss->id; in cgroup_init_subsys()
5794 struct cgroup_subsys *ss; in cgroup_init_early() local
5803 for_each_subsys(ss, i) { in cgroup_init_early()
5804 WARN(!ss->css_alloc || !ss->css_free || ss->name || ss->id, in cgroup_init_early()
5806 i, cgroup_subsys_name[i], ss->css_alloc, ss->css_free, in cgroup_init_early()
5807 ss->id, ss->name); in cgroup_init_early()
5811 ss->id = i; in cgroup_init_early()
5812 ss->name = cgroup_subsys_name[i]; in cgroup_init_early()
5813 if (!ss->legacy_name) in cgroup_init_early()
5814 ss->legacy_name = cgroup_subsys_name[i]; in cgroup_init_early()
5816 if (ss->early_init) in cgroup_init_early()
5817 cgroup_init_subsys(ss, true); in cgroup_init_early()
5830 struct cgroup_subsys *ss; in cgroup_init() local
5860 for_each_subsys(ss, ssid) { in cgroup_init()
5861 if (ss->early_init) { in cgroup_init()
5863 init_css_set.subsys[ss->id]; in cgroup_init()
5865 css->id = cgroup_idr_alloc(&ss->css_idr, css, 1, 2, in cgroup_init()
5869 cgroup_init_subsys(ss, false); in cgroup_init()
5885 ss->name); in cgroup_init()
5887 cgrp_dfl_root.subsys_mask |= 1 << ss->id; in cgroup_init()
5890 WARN_ON(ss->implicit_on_dfl && !ss->threaded); in cgroup_init()
5892 if (ss->implicit_on_dfl) in cgroup_init()
5893 cgrp_dfl_implicit_ss_mask |= 1 << ss->id; in cgroup_init()
5894 else if (!ss->dfl_cftypes) in cgroup_init()
5895 cgrp_dfl_inhibit_ss_mask |= 1 << ss->id; in cgroup_init()
5897 if (ss->threaded) in cgroup_init()
5898 cgrp_dfl_threaded_ss_mask |= 1 << ss->id; in cgroup_init()
5900 if (ss->dfl_cftypes == ss->legacy_cftypes) { in cgroup_init()
5901 WARN_ON(cgroup_add_cftypes(ss, ss->dfl_cftypes)); in cgroup_init()
5903 WARN_ON(cgroup_add_dfl_cftypes(ss, ss->dfl_cftypes)); in cgroup_init()
5904 WARN_ON(cgroup_add_legacy_cftypes(ss, ss->legacy_cftypes)); in cgroup_init()
5907 if (ss->bind) in cgroup_init()
5908 ss->bind(init_css_set.subsys[ssid]); in cgroup_init()
6007 struct cgroup_subsys *ss; in proc_cgroup_show() local
6016 for_each_subsys(ss, ssid) in proc_cgroup_show()
6019 ss->legacy_name); in proc_cgroup_show()
6235 struct cgroup_subsys *ss; in cgroup_can_fork() local
6242 do_each_subsys_mask(ss, i, have_canfork_callback) { in cgroup_can_fork()
6243 ret = ss->can_fork(child, kargs->cset); in cgroup_can_fork()
6251 for_each_subsys(ss, j) { in cgroup_can_fork()
6254 if (ss->cancel_fork) in cgroup_can_fork()
6255 ss->cancel_fork(child, kargs->cset); in cgroup_can_fork()
6275 struct cgroup_subsys *ss; in cgroup_cancel_fork() local
6278 for_each_subsys(ss, i) in cgroup_cancel_fork()
6279 if (ss->cancel_fork) in cgroup_cancel_fork()
6280 ss->cancel_fork(child, kargs->cset); in cgroup_cancel_fork()
6298 struct cgroup_subsys *ss; in cgroup_post_fork() local
6357 do_each_subsys_mask(ss, i, have_fork_callback) { in cgroup_post_fork()
6358 ss->fork(child); in cgroup_post_fork()
6386 struct cgroup_subsys *ss; in cgroup_exit() local
6406 do_each_subsys_mask(ss, i, have_exit_callback) { in cgroup_exit()
6407 ss->exit(tsk); in cgroup_exit()
6413 struct cgroup_subsys *ss; in cgroup_release() local
6416 do_each_subsys_mask(ss, ssid, have_release_callback) { in cgroup_release()
6417 ss->release(task); in cgroup_release()
6434 struct cgroup_subsys *ss; in cgroup_disable() local
6442 for_each_subsys(ss, i) { in cgroup_disable()
6443 if (strcmp(token, ss->name) && in cgroup_disable()
6444 strcmp(token, ss->legacy_name)) in cgroup_disable()
6449 ss->name); in cgroup_disable()
6485 struct cgroup_subsys *ss) in css_tryget_online_from_dir() argument
6506 css = cgroup_css(cgrp, ss); in css_tryget_online_from_dir()
6523 struct cgroup_subsys_state *css_from_id(int id, struct cgroup_subsys *ss) in css_from_id() argument
6526 return idr_find(&ss->css_idr, id); in css_from_id()
6719 struct cgroup_subsys *ss; in delegate_show() local
6726 for_each_subsys(ss, ssid) in delegate_show()
6727 ret += show_delegatable_files(ss->dfl_cftypes, buf + ret, in delegate_show()