Lines Matching refs:ss
245 struct cgroup_subsys *ss);
486 struct cgroup_subsys *ss) in cgroup_css() argument
488 if (CGROUP_HAS_SUBSYS_CONFIG && ss) in cgroup_css()
489 return rcu_dereference_check(cgrp->subsys[ss->id], in cgroup_css()
506 struct cgroup_subsys *ss) in cgroup_e_css_by_mask() argument
510 if (!ss) in cgroup_e_css_by_mask()
517 while (!(cgroup_ss_mask(cgrp) & (1 << ss->id))) { in cgroup_e_css_by_mask()
523 return cgroup_css(cgrp, ss); in cgroup_e_css_by_mask()
540 struct cgroup_subsys *ss) in cgroup_e_css() argument
548 css = cgroup_css(cgrp, ss); in cgroup_e_css()
555 return init_css_set.subsys[ss->id]; in cgroup_e_css()
570 struct cgroup_subsys *ss) in cgroup_get_e_css() argument
580 css = cgroup_css(cgrp, ss); in cgroup_get_e_css()
587 css = init_css_set.subsys[ss->id]; in cgroup_get_e_css()
647 if (CGROUP_HAS_SUBSYS_CONFIG && cft->ss) in of_css()
648 return rcu_dereference_raw(cgrp->subsys[cft->ss->id]); in of_css()
678 #define do_each_subsys_mask(ss, ssid, ss_mask) do { \ argument
685 (ss) = cgroup_subsys[ssid]; \
913 struct cgroup_subsys *ss; in css_set_hash() local
916 for_each_subsys(ss, i) in css_set_hash()
926 struct cgroup_subsys *ss; in put_css_set_locked() local
937 for_each_subsys(ss, ssid) { in put_css_set_locked()
1054 struct cgroup_subsys *ss; in find_existing_css_set() local
1064 for_each_subsys(ss, i) { in find_existing_css_set()
1070 template[i] = cgroup_e_css_by_mask(cgrp, ss); in find_existing_css_set()
1175 struct cgroup_subsys *ss; in find_css_set() local
1237 for_each_subsys(ss, ssid) { in find_css_set()
1499 struct cgroup_subsys *ss = cft->ss; in cgroup_file_name() local
1501 if (cft->ss && !(cft->flags & CFTYPE_NO_PREFIX) && in cgroup_file_name()
1506 dbg, cgroup_on_dfl(cgrp) ? ss->name : ss->legacy_name, in cgroup_file_name()
1552 struct cgroup_subsys *ss; in cgroup_calc_subtree_ss_mask() local
1562 do_each_subsys_mask(ss, ssid, cur_ss_mask) { in cgroup_calc_subtree_ss_mask()
1563 new_ss_mask |= ss->depends_on; in cgroup_calc_subtree_ss_mask()
1661 struct cgroup_subsys_state *css = cgroup_css(cgrp, cft->ss); in cgroup_rm_file()
1688 if (!css->ss) { in css_clear_dir()
1700 list_for_each_entry(cfts, &css->ss->cfts, node) in css_clear_dir()
1720 if (!css->ss) { in css_populate_dir()
1738 list_for_each_entry(cfts, &css->ss->cfts, node) { in css_populate_dir()
1751 list_for_each_entry(cfts, &css->ss->cfts, node) { in css_populate_dir()
1762 struct cgroup_subsys *ss; in rebind_subsystems() local
1768 do_each_subsys_mask(ss, ssid, ss_mask) { in rebind_subsystems()
1774 if (css_next_child(NULL, cgroup_css(&ss->root->cgrp, ss)) && in rebind_subsystems()
1775 !ss->implicit_on_dfl) in rebind_subsystems()
1779 if (ss->root != &cgrp_dfl_root && dst_root != &cgrp_dfl_root) in rebind_subsystems()
1786 if (ss->root == &cgrp_dfl_root) in rebind_subsystems()
1803 do_each_subsys_mask(ss, ssid, ss_mask) { in rebind_subsystems()
1804 struct cgroup_root *src_root = ss->root; in rebind_subsystems()
1806 struct cgroup_subsys_state *css = cgroup_css(scgrp, ss); in rebind_subsystems()
1810 WARN_ON(!css || cgroup_css(dcgrp, ss)); in rebind_subsystems()
1822 ss->root = dst_root; in rebind_subsystems()
1826 WARN_ON(!list_empty(&dcgrp->e_csets[ss->id])); in rebind_subsystems()
1827 list_for_each_entry_safe(cset, cset_pos, &scgrp->e_csets[ss->id], in rebind_subsystems()
1828 e_cset_node[ss->id]) { in rebind_subsystems()
1829 list_move_tail(&cset->e_cset_node[ss->id], in rebind_subsystems()
1830 &dcgrp->e_csets[ss->id]); in rebind_subsystems()
1839 if (it->cset_head == &scgrp->e_csets[ss->id]) in rebind_subsystems()
1840 it->cset_head = &dcgrp->e_csets[ss->id]; in rebind_subsystems()
1844 if (ss->css_rstat_flush) { in rebind_subsystems()
1863 ss->name, ret); in rebind_subsystems()
1865 if (ss->bind) in rebind_subsystems()
1866 ss->bind(css); in rebind_subsystems()
1989 struct cgroup_subsys *ss; in init_cgroup_housekeeping() local
2005 for_each_subsys(ss, ssid) in init_cgroup_housekeeping()
2511 struct cgroup_subsys *ss; in cgroup_migrate_execute() local
2518 do_each_subsys_mask(ss, ssid, mgctx->ss_mask) { in cgroup_migrate_execute()
2519 if (ss->can_attach) { in cgroup_migrate_execute()
2521 ret = ss->can_attach(tset); in cgroup_migrate_execute()
2565 do_each_subsys_mask(ss, ssid, mgctx->ss_mask) { in cgroup_migrate_execute()
2566 if (ss->attach) { in cgroup_migrate_execute()
2568 ss->attach(tset); in cgroup_migrate_execute()
2578 do_each_subsys_mask(ss, ssid, mgctx->ss_mask) { in cgroup_migrate_execute()
2581 if (ss->cancel_attach) { in cgroup_migrate_execute()
2583 ss->cancel_attach(tset); in cgroup_migrate_execute()
2748 struct cgroup_subsys *ss; in cgroup_migrate_prepare_dst() local
2779 for_each_subsys(ss, ssid) in cgroup_migrate_prepare_dst()
2926 struct cgroup_subsys *ss; in cgroup_procs_write_finish() local
2934 for_each_subsys(ss, ssid) in cgroup_procs_write_finish()
2935 if (ss->post_attach) in cgroup_procs_write_finish()
2936 ss->post_attach(); in cgroup_procs_write_finish()
2941 struct cgroup_subsys *ss; in cgroup_print_ss_mask() local
2945 do_each_subsys_mask(ss, ssid, ss_mask) { in cgroup_print_ss_mask()
2948 seq_puts(seq, ss->name); in cgroup_print_ss_mask()
3057 struct cgroup_subsys *ss; in cgroup_lock_and_drain_offline() local
3064 for_each_subsys(ss, ssid) { in cgroup_lock_and_drain_offline()
3065 struct cgroup_subsys_state *css = cgroup_css(dsct, ss); in cgroup_lock_and_drain_offline()
3148 struct cgroup_subsys *ss = css->ss; in css_visible() local
3151 if (cgroup_control(cgrp) & (1 << ss->id)) in css_visible()
3153 if (!(cgroup_ss_mask(cgrp) & (1 << ss->id))) in css_visible()
3155 return cgroup_on_dfl(cgrp) && ss->implicit_on_dfl; in css_visible()
3175 struct cgroup_subsys *ss; in cgroup_apply_control_enable() local
3179 for_each_subsys(ss, ssid) { in cgroup_apply_control_enable()
3180 struct cgroup_subsys_state *css = cgroup_css(dsct, ss); in cgroup_apply_control_enable()
3182 if (!(cgroup_ss_mask(dsct) & (1 << ss->id))) in cgroup_apply_control_enable()
3186 css = css_create(dsct, ss); in cgroup_apply_control_enable()
3221 struct cgroup_subsys *ss; in cgroup_apply_control_disable() local
3225 for_each_subsys(ss, ssid) { in cgroup_apply_control_disable()
3226 struct cgroup_subsys_state *css = cgroup_css(dsct, ss); in cgroup_apply_control_disable()
3234 !(cgroup_ss_mask(dsct) & (1 << ss->id))) { in cgroup_apply_control_disable()
3238 if (ss->css_reset) in cgroup_apply_control_disable()
3239 ss->css_reset(css); in cgroup_apply_control_disable()
3344 struct cgroup_subsys *ss; in cgroup_subtree_control_write() local
3356 do_each_subsys_mask(ss, ssid, ~cgrp_dfl_inhibit_ss_mask) { in cgroup_subtree_control_write()
3358 strcmp(tok + 1, ss->name)) in cgroup_subtree_control_write()
3380 for_each_subsys(ss, ssid) { in cgroup_subtree_control_write()
3645 struct cgroup_subsys *ss) in cgroup_tryget_css() argument
3650 css = cgroup_css(cgrp, ss); in cgroup_tryget_css()
3661 struct cgroup_subsys *ss = cgroup_subsys[ssid]; in cgroup_extra_stat_show() local
3665 if (!ss->css_extra_stat_show) in cgroup_extra_stat_show()
3668 css = cgroup_tryget_css(cgrp, ss); in cgroup_extra_stat_show()
3672 ret = ss->css_extra_stat_show(seq, css); in cgroup_extra_stat_show()
3680 struct cgroup_subsys *ss = cgroup_subsys[ssid]; in cgroup_local_stat_show() local
3684 if (!ss->css_local_stat_show) in cgroup_local_stat_show()
3687 css = cgroup_tryget_css(cgrp, ss); in cgroup_local_stat_show()
3691 ret = ss->css_local_stat_show(seq, css); in cgroup_local_stat_show()
4070 css = cgroup_css(cgrp, cft->ss); in cgroup_file_write()
4262 struct cgroup_subsys *ss = cfts[0].ss; in cgroup_apply_cftypes() local
4263 struct cgroup *root = &ss->root->cgrp; in cgroup_apply_cftypes()
4270 css_for_each_descendant_pre(css, cgroup_css(root, ss)) { in cgroup_apply_cftypes()
4295 cft->ss = NULL; in cgroup_exit_cftypes()
4303 static int cgroup_init_cftypes(struct cgroup_subsys *ss, struct cftype *cfts) in cgroup_init_cftypes() argument
4311 WARN_ON(cft->ss || cft->kf_ops); in cgroup_init_cftypes()
4337 cft->ss = ss; in cgroup_init_cftypes()
4394 static int cgroup_add_cftypes(struct cgroup_subsys *ss, struct cftype *cfts) in cgroup_add_cftypes() argument
4398 if (!cgroup_ssid_enabled(ss->id)) in cgroup_add_cftypes()
4404 ret = cgroup_init_cftypes(ss, cfts); in cgroup_add_cftypes()
4410 list_add_tail(&cfts->node, &ss->cfts); in cgroup_add_cftypes()
4427 int cgroup_add_dfl_cftypes(struct cgroup_subsys *ss, struct cftype *cfts) in cgroup_add_dfl_cftypes() argument
4433 return cgroup_add_cftypes(ss, cfts); in cgroup_add_dfl_cftypes()
4444 int cgroup_add_legacy_cftypes(struct cgroup_subsys *ss, struct cftype *cfts) in cgroup_add_legacy_cftypes() argument
4450 return cgroup_add_cftypes(ss, cfts); in cgroup_add_legacy_cftypes()
4756 if (it->ss) { in css_task_iter_next_css_set()
4757 cset = container_of(l, struct css_set, e_cset_node[it->ss->id]); in css_task_iter_next_css_set()
4916 it->ss = css->ss; in css_task_iter_start()
4919 if (CGROUP_HAS_SUBSYS_CONFIG && it->ss) in css_task_iter_start()
4920 it->cset_pos = &css->cgroup->e_csets[css->ss->id]; in css_task_iter_start()
5336 struct cgroup_subsys *ss = css->ss; in css_free_rwork_fn() local
5341 if (ss) { in css_free_rwork_fn()
5346 ss->css_free(css); in css_free_rwork_fn()
5347 cgroup_idr_remove(&ss->css_idr, id); in css_free_rwork_fn()
5386 struct cgroup_subsys *ss = css->ss; in css_release_work_fn() local
5394 if (ss) { in css_release_work_fn()
5401 cgroup_idr_replace(&ss->css_idr, NULL, css->id); in css_release_work_fn()
5402 if (ss->css_released) in css_release_work_fn()
5403 ss->css_released(css); in css_release_work_fn()
5446 struct cgroup_subsys *ss, struct cgroup *cgrp) in init_and_link_css() argument
5454 css->ss = ss; in init_and_link_css()
5463 css->parent = cgroup_css(cgroup_parent(cgrp), ss); in init_and_link_css()
5467 if (ss->css_rstat_flush) in init_and_link_css()
5470 BUG_ON(cgroup_css(cgrp, ss)); in init_and_link_css()
5476 struct cgroup_subsys *ss = css->ss; in online_css() local
5481 if (ss->css_online) in online_css()
5482 ret = ss->css_online(css); in online_css()
5485 rcu_assign_pointer(css->cgroup->subsys[ss->id], css); in online_css()
5497 struct cgroup_subsys *ss = css->ss; in offline_css() local
5504 if (ss->css_offline) in offline_css()
5505 ss->css_offline(css); in offline_css()
5508 RCU_INIT_POINTER(css->cgroup->subsys[ss->id], NULL); in offline_css()
5523 struct cgroup_subsys *ss) in css_create() argument
5526 struct cgroup_subsys_state *parent_css = cgroup_css(parent, ss); in css_create()
5532 css = ss->css_alloc(parent_css); in css_create()
5538 init_and_link_css(css, ss, cgrp); in css_create()
5544 err = cgroup_idr_alloc(&ss->css_idr, NULL, 2, 0, GFP_KERNEL); in css_create()
5551 cgroup_idr_replace(&ss->css_idr, css, css->id); in css_create()
5964 static void __init cgroup_init_subsys(struct cgroup_subsys *ss, bool early) in cgroup_init_subsys() argument
5968 pr_debug("Initializing cgroup subsys %s\n", ss->name); in cgroup_init_subsys()
5972 idr_init(&ss->css_idr); in cgroup_init_subsys()
5973 INIT_LIST_HEAD(&ss->cfts); in cgroup_init_subsys()
5976 ss->root = &cgrp_dfl_root; in cgroup_init_subsys()
5977 css = ss->css_alloc(NULL); in cgroup_init_subsys()
5980 init_and_link_css(css, ss, &cgrp_dfl_root.cgrp); in cgroup_init_subsys()
5992 css->id = cgroup_idr_alloc(&ss->css_idr, css, 1, 2, GFP_KERNEL); in cgroup_init_subsys()
6000 init_css_set.subsys[ss->id] = css; in cgroup_init_subsys()
6002 have_fork_callback |= (bool)ss->fork << ss->id; in cgroup_init_subsys()
6003 have_exit_callback |= (bool)ss->exit << ss->id; in cgroup_init_subsys()
6004 have_release_callback |= (bool)ss->release << ss->id; in cgroup_init_subsys()
6005 have_canfork_callback |= (bool)ss->can_fork << ss->id; in cgroup_init_subsys()
6026 struct cgroup_subsys *ss; in cgroup_init_early() local
6035 for_each_subsys(ss, i) { in cgroup_init_early()
6036 WARN(!ss->css_alloc || !ss->css_free || ss->name || ss->id, in cgroup_init_early()
6038 i, cgroup_subsys_name[i], ss->css_alloc, ss->css_free, in cgroup_init_early()
6039 ss->id, ss->name); in cgroup_init_early()
6043 ss->id = i; in cgroup_init_early()
6044 ss->name = cgroup_subsys_name[i]; in cgroup_init_early()
6045 if (!ss->legacy_name) in cgroup_init_early()
6046 ss->legacy_name = cgroup_subsys_name[i]; in cgroup_init_early()
6048 if (ss->early_init) in cgroup_init_early()
6049 cgroup_init_subsys(ss, true); in cgroup_init_early()
6062 struct cgroup_subsys *ss; in cgroup_init() local
6087 for_each_subsys(ss, ssid) { in cgroup_init()
6088 if (ss->early_init) { in cgroup_init()
6090 init_css_set.subsys[ss->id]; in cgroup_init()
6092 css->id = cgroup_idr_alloc(&ss->css_idr, css, 1, 2, in cgroup_init()
6096 cgroup_init_subsys(ss, false); in cgroup_init()
6112 ss->name); in cgroup_init()
6114 cgrp_dfl_root.subsys_mask |= 1 << ss->id; in cgroup_init()
6117 WARN_ON(ss->implicit_on_dfl && !ss->threaded); in cgroup_init()
6119 if (ss->implicit_on_dfl) in cgroup_init()
6120 cgrp_dfl_implicit_ss_mask |= 1 << ss->id; in cgroup_init()
6121 else if (!ss->dfl_cftypes) in cgroup_init()
6122 cgrp_dfl_inhibit_ss_mask |= 1 << ss->id; in cgroup_init()
6124 if (ss->threaded) in cgroup_init()
6125 cgrp_dfl_threaded_ss_mask |= 1 << ss->id; in cgroup_init()
6127 if (ss->dfl_cftypes == ss->legacy_cftypes) { in cgroup_init()
6128 WARN_ON(cgroup_add_cftypes(ss, ss->dfl_cftypes)); in cgroup_init()
6130 WARN_ON(cgroup_add_dfl_cftypes(ss, ss->dfl_cftypes)); in cgroup_init()
6131 WARN_ON(cgroup_add_legacy_cftypes(ss, ss->legacy_cftypes)); in cgroup_init()
6134 if (ss->bind) in cgroup_init()
6135 ss->bind(init_css_set.subsys[ssid]); in cgroup_init()
6248 struct cgroup_subsys *ss; in proc_cgroup_show() local
6257 for_each_subsys(ss, ssid) in proc_cgroup_show()
6260 ss->legacy_name); in proc_cgroup_show()
6511 struct cgroup_subsys *ss; in cgroup_can_fork() local
6518 do_each_subsys_mask(ss, i, have_canfork_callback) { in cgroup_can_fork()
6519 ret = ss->can_fork(child, kargs->cset); in cgroup_can_fork()
6527 for_each_subsys(ss, j) { in cgroup_can_fork()
6530 if (ss->cancel_fork) in cgroup_can_fork()
6531 ss->cancel_fork(child, kargs->cset); in cgroup_can_fork()
6551 struct cgroup_subsys *ss; in cgroup_cancel_fork() local
6554 for_each_subsys(ss, i) in cgroup_cancel_fork()
6555 if (ss->cancel_fork) in cgroup_cancel_fork()
6556 ss->cancel_fork(child, kargs->cset); in cgroup_cancel_fork()
6575 struct cgroup_subsys *ss; in cgroup_post_fork() local
6634 do_each_subsys_mask(ss, i, have_fork_callback) { in cgroup_post_fork()
6635 ss->fork(child); in cgroup_post_fork()
6663 struct cgroup_subsys *ss; in cgroup_exit() local
6686 do_each_subsys_mask(ss, i, have_exit_callback) { in cgroup_exit()
6687 ss->exit(tsk); in cgroup_exit()
6693 struct cgroup_subsys *ss; in cgroup_release() local
6696 do_each_subsys_mask(ss, ssid, have_release_callback) { in cgroup_release()
6697 ss->release(task); in cgroup_release()
6714 struct cgroup_subsys *ss; in cgroup_disable() local
6722 for_each_subsys(ss, i) { in cgroup_disable()
6723 if (strcmp(token, ss->name) && in cgroup_disable()
6724 strcmp(token, ss->legacy_name)) in cgroup_disable()
6729 ss->name); in cgroup_disable()
6765 struct cgroup_subsys *ss) in css_tryget_online_from_dir() argument
6786 css = cgroup_css(cgrp, ss); in css_tryget_online_from_dir()
6803 struct cgroup_subsys_state *css_from_id(int id, struct cgroup_subsys *ss) in css_from_id() argument
6806 return idr_find(&ss->css_idr, id); in css_from_id()
7015 struct cgroup_subsys *ss; in delegate_show() local
7025 for_each_subsys(ss, ssid) in delegate_show()
7026 ret += show_delegatable_files(ss->dfl_cftypes, buf + ret, in delegate_show()