Lines Matching refs:ss
249 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()
504 struct cgroup_subsys *ss) in cgroup_tryget_css() argument
509 css = cgroup_css(cgrp, ss); in cgroup_tryget_css()
528 struct cgroup_subsys *ss) in cgroup_e_css_by_mask() argument
532 if (!ss) in cgroup_e_css_by_mask()
539 while (!(cgroup_ss_mask(cgrp) & (1 << ss->id))) { in cgroup_e_css_by_mask()
545 return cgroup_css(cgrp, ss); in cgroup_e_css_by_mask()
562 struct cgroup_subsys *ss) in cgroup_e_css() argument
570 css = cgroup_css(cgrp, ss); in cgroup_e_css()
577 return init_css_set.subsys[ss->id]; in cgroup_e_css()
592 struct cgroup_subsys *ss) in cgroup_get_e_css() argument
602 css = cgroup_css(cgrp, ss); in cgroup_get_e_css()
609 css = init_css_set.subsys[ss->id]; in cgroup_get_e_css()
669 if (CGROUP_HAS_SUBSYS_CONFIG && cft->ss) in of_css()
670 return rcu_dereference_raw(cgrp->subsys[cft->ss->id]); in of_css()
715 #define do_each_subsys_mask(ss, ssid, ss_mask) do { \ argument
722 (ss) = cgroup_subsys[ssid]; \
950 struct cgroup_subsys *ss; in css_set_hash() local
953 for_each_subsys(ss, i) in css_set_hash()
963 struct cgroup_subsys *ss; in put_css_set_locked() local
974 for_each_subsys(ss, ssid) { in put_css_set_locked()
1091 struct cgroup_subsys *ss; in find_existing_css_set() local
1101 for_each_subsys(ss, i) { in find_existing_css_set()
1107 template[i] = cgroup_e_css_by_mask(cgrp, ss); in find_existing_css_set()
1212 struct cgroup_subsys *ss; in find_css_set() local
1274 for_each_subsys(ss, ssid) { in find_css_set()
1526 struct cgroup_subsys *ss = cft->ss; in cgroup_file_name() local
1528 if (cft->ss && !(cft->flags & CFTYPE_NO_PREFIX) && in cgroup_file_name()
1533 dbg, cgroup_on_dfl(cgrp) ? ss->name : ss->legacy_name, in cgroup_file_name()
1579 struct cgroup_subsys *ss; in cgroup_calc_subtree_ss_mask() local
1589 do_each_subsys_mask(ss, ssid, cur_ss_mask) { in cgroup_calc_subtree_ss_mask()
1590 new_ss_mask |= ss->depends_on; in cgroup_calc_subtree_ss_mask()
1688 struct cgroup_subsys_state *css = cgroup_css(cgrp, cft->ss); in cgroup_rm_file()
1715 if (!css->ss) { in css_clear_dir()
1727 list_for_each_entry(cfts, &css->ss->cfts, node) in css_clear_dir()
1747 if (!css->ss) { in css_populate_dir()
1765 list_for_each_entry(cfts, &css->ss->cfts, node) { in css_populate_dir()
1778 list_for_each_entry(cfts, &css->ss->cfts, node) { in css_populate_dir()
1789 struct cgroup_subsys *ss; in rebind_subsystems() local
1795 do_each_subsys_mask(ss, ssid, ss_mask) { in rebind_subsystems()
1801 if (css_next_child(NULL, cgroup_css(&ss->root->cgrp, ss)) && in rebind_subsystems()
1802 !ss->implicit_on_dfl) in rebind_subsystems()
1806 if (ss->root != &cgrp_dfl_root && dst_root != &cgrp_dfl_root) in rebind_subsystems()
1813 if (ss->root == &cgrp_dfl_root) in rebind_subsystems()
1830 do_each_subsys_mask(ss, ssid, ss_mask) { in rebind_subsystems()
1831 struct cgroup_root *src_root = ss->root; in rebind_subsystems()
1833 struct cgroup_subsys_state *css = cgroup_css(scgrp, ss); in rebind_subsystems()
1837 WARN_ON(!css || cgroup_css(dcgrp, ss)); in rebind_subsystems()
1849 ss->root = dst_root; in rebind_subsystems()
1853 WARN_ON(!list_empty(&dcgrp->e_csets[ss->id])); in rebind_subsystems()
1854 list_for_each_entry_safe(cset, cset_pos, &scgrp->e_csets[ss->id], in rebind_subsystems()
1855 e_cset_node[ss->id]) { in rebind_subsystems()
1856 list_move_tail(&cset->e_cset_node[ss->id], in rebind_subsystems()
1857 &dcgrp->e_csets[ss->id]); in rebind_subsystems()
1866 if (it->cset_head == &scgrp->e_csets[ss->id]) in rebind_subsystems()
1867 it->cset_head = &dcgrp->e_csets[ss->id]; in rebind_subsystems()
1871 if (ss->css_rstat_flush) { in rebind_subsystems()
1890 ss->name, ret); in rebind_subsystems()
1892 if (ss->bind) in rebind_subsystems()
1893 ss->bind(css); in rebind_subsystems()
2016 struct cgroup_subsys *ss; in init_cgroup_housekeeping() local
2032 for_each_subsys(ss, ssid) in init_cgroup_housekeeping()
2579 struct cgroup_subsys *ss; in cgroup_migrate_execute() local
2586 do_each_subsys_mask(ss, ssid, mgctx->ss_mask) { in cgroup_migrate_execute()
2587 if (ss->can_attach) { in cgroup_migrate_execute()
2589 ret = ss->can_attach(tset); in cgroup_migrate_execute()
2633 do_each_subsys_mask(ss, ssid, mgctx->ss_mask) { in cgroup_migrate_execute()
2634 if (ss->attach) { in cgroup_migrate_execute()
2636 trace_android_vh_cgroup_attach(ss, tset); in cgroup_migrate_execute()
2637 ss->attach(tset); in cgroup_migrate_execute()
2647 do_each_subsys_mask(ss, ssid, mgctx->ss_mask) { in cgroup_migrate_execute()
2650 if (ss->cancel_attach) { in cgroup_migrate_execute()
2652 ss->cancel_attach(tset); in cgroup_migrate_execute()
2817 struct cgroup_subsys *ss; in cgroup_migrate_prepare_dst() local
2848 for_each_subsys(ss, ssid) in cgroup_migrate_prepare_dst()
3002 struct cgroup_subsys *ss; in cgroup_procs_write_finish() local
3010 for_each_subsys(ss, ssid) in cgroup_procs_write_finish()
3011 if (ss->post_attach) in cgroup_procs_write_finish()
3012 ss->post_attach(); in cgroup_procs_write_finish()
3017 struct cgroup_subsys *ss; in cgroup_print_ss_mask() local
3021 do_each_subsys_mask(ss, ssid, ss_mask) { in cgroup_print_ss_mask()
3024 seq_puts(seq, ss->name); in cgroup_print_ss_mask()
3133 struct cgroup_subsys *ss; in cgroup_lock_and_drain_offline() local
3140 for_each_subsys(ss, ssid) { in cgroup_lock_and_drain_offline()
3141 struct cgroup_subsys_state *css = cgroup_css(dsct, ss); in cgroup_lock_and_drain_offline()
3224 struct cgroup_subsys *ss = css->ss; in css_visible() local
3227 if (cgroup_control(cgrp) & (1 << ss->id)) in css_visible()
3229 if (!(cgroup_ss_mask(cgrp) & (1 << ss->id))) in css_visible()
3231 return cgroup_on_dfl(cgrp) && ss->implicit_on_dfl; in css_visible()
3251 struct cgroup_subsys *ss; in cgroup_apply_control_enable() local
3255 for_each_subsys(ss, ssid) { in cgroup_apply_control_enable()
3256 struct cgroup_subsys_state *css = cgroup_css(dsct, ss); in cgroup_apply_control_enable()
3258 if (!(cgroup_ss_mask(dsct) & (1 << ss->id))) in cgroup_apply_control_enable()
3262 css = css_create(dsct, ss); in cgroup_apply_control_enable()
3297 struct cgroup_subsys *ss; in cgroup_apply_control_disable() local
3301 for_each_subsys(ss, ssid) { in cgroup_apply_control_disable()
3302 struct cgroup_subsys_state *css = cgroup_css(dsct, ss); in cgroup_apply_control_disable()
3310 !(cgroup_ss_mask(dsct) & (1 << ss->id))) { in cgroup_apply_control_disable()
3314 if (ss->css_reset) in cgroup_apply_control_disable()
3315 ss->css_reset(css); in cgroup_apply_control_disable()
3420 struct cgroup_subsys *ss; in cgroup_subtree_control_write() local
3432 do_each_subsys_mask(ss, ssid, ~cgrp_dfl_inhibit_ss_mask) { in cgroup_subtree_control_write()
3434 strcmp(tok + 1, ss->name)) in cgroup_subtree_control_write()
3456 for_each_subsys(ss, ssid) { in cgroup_subtree_control_write()
3714 struct cgroup_subsys *ss = cgroup_subsys[ssid]; in cgroup_extra_stat_show() local
3718 if (!ss->css_extra_stat_show) in cgroup_extra_stat_show()
3721 css = cgroup_tryget_css(cgrp, ss); in cgroup_extra_stat_show()
3725 ret = ss->css_extra_stat_show(seq, css); in cgroup_extra_stat_show()
4099 css = cgroup_css(cgrp, cft->ss); in cgroup_file_write()
4291 struct cgroup_subsys *ss = cfts[0].ss; in cgroup_apply_cftypes() local
4292 struct cgroup *root = &ss->root->cgrp; in cgroup_apply_cftypes()
4299 css_for_each_descendant_pre(css, cgroup_css(root, ss)) { in cgroup_apply_cftypes()
4324 cft->ss = NULL; in cgroup_exit_cftypes()
4332 static int cgroup_init_cftypes(struct cgroup_subsys *ss, struct cftype *cfts) in cgroup_init_cftypes() argument
4340 WARN_ON(cft->ss || cft->kf_ops); in cgroup_init_cftypes()
4366 cft->ss = ss; in cgroup_init_cftypes()
4426 static int cgroup_add_cftypes(struct cgroup_subsys *ss, struct cftype *cfts) in cgroup_add_cftypes() argument
4430 if (!cgroup_ssid_enabled(ss->id)) in cgroup_add_cftypes()
4436 ret = cgroup_init_cftypes(ss, cfts); in cgroup_add_cftypes()
4442 list_add_tail(&cfts->node, &ss->cfts); in cgroup_add_cftypes()
4459 int cgroup_add_dfl_cftypes(struct cgroup_subsys *ss, struct cftype *cfts) in cgroup_add_dfl_cftypes() argument
4465 return cgroup_add_cftypes(ss, cfts); in cgroup_add_dfl_cftypes()
4477 int cgroup_add_legacy_cftypes(struct cgroup_subsys *ss, struct cftype *cfts) in cgroup_add_legacy_cftypes() argument
4483 return cgroup_add_cftypes(ss, cfts); in cgroup_add_legacy_cftypes()
4791 if (it->ss) { in css_task_iter_next_css_set()
4792 cset = container_of(l, struct css_set, e_cset_node[it->ss->id]); in css_task_iter_next_css_set()
4951 it->ss = css->ss; in css_task_iter_start()
4954 if (CGROUP_HAS_SUBSYS_CONFIG && it->ss) in css_task_iter_start()
4955 it->cset_pos = &css->cgroup->e_csets[css->ss->id]; in css_task_iter_start()
5371 struct cgroup_subsys *ss = css->ss; in css_free_rwork_fn() local
5376 if (ss) { in css_free_rwork_fn()
5381 ss->css_free(css); in css_free_rwork_fn()
5382 cgroup_idr_remove(&ss->css_idr, id); in css_free_rwork_fn()
5420 struct cgroup_subsys *ss = css->ss; in css_release_work_fn() local
5428 if (ss) { in css_release_work_fn()
5435 cgroup_idr_replace(&ss->css_idr, NULL, css->id); in css_release_work_fn()
5436 if (ss->css_released) in css_release_work_fn()
5437 ss->css_released(css); in css_release_work_fn()
5480 struct cgroup_subsys *ss, struct cgroup *cgrp) in init_and_link_css() argument
5488 css->ss = ss; in init_and_link_css()
5497 css->parent = cgroup_css(cgroup_parent(cgrp), ss); in init_and_link_css()
5501 if (ss->css_rstat_flush) in init_and_link_css()
5504 BUG_ON(cgroup_css(cgrp, ss)); in init_and_link_css()
5510 struct cgroup_subsys *ss = css->ss; in online_css() local
5515 if (ss->css_online) in online_css()
5516 ret = ss->css_online(css); in online_css()
5519 rcu_assign_pointer(css->cgroup->subsys[ss->id], css); in online_css()
5531 struct cgroup_subsys *ss = css->ss; in offline_css() local
5538 if (ss->css_offline) in offline_css()
5539 ss->css_offline(css); in offline_css()
5542 RCU_INIT_POINTER(css->cgroup->subsys[ss->id], NULL); in offline_css()
5557 struct cgroup_subsys *ss) in css_create() argument
5560 struct cgroup_subsys_state *parent_css = cgroup_css(parent, ss); in css_create()
5566 css = ss->css_alloc(parent_css); in css_create()
5572 init_and_link_css(css, ss, cgrp); in css_create()
5578 err = cgroup_idr_alloc(&ss->css_idr, NULL, 2, 0, GFP_KERNEL); in css_create()
5585 cgroup_idr_replace(&ss->css_idr, css, css->id); in css_create()
5999 static void __init cgroup_init_subsys(struct cgroup_subsys *ss, bool early) in cgroup_init_subsys() argument
6003 pr_debug("Initializing cgroup subsys %s\n", ss->name); in cgroup_init_subsys()
6007 idr_init(&ss->css_idr); in cgroup_init_subsys()
6008 INIT_LIST_HEAD(&ss->cfts); in cgroup_init_subsys()
6011 ss->root = &cgrp_dfl_root; in cgroup_init_subsys()
6012 css = ss->css_alloc(NULL); in cgroup_init_subsys()
6015 init_and_link_css(css, ss, &cgrp_dfl_root.cgrp); in cgroup_init_subsys()
6027 css->id = cgroup_idr_alloc(&ss->css_idr, css, 1, 2, GFP_KERNEL); in cgroup_init_subsys()
6035 init_css_set.subsys[ss->id] = css; in cgroup_init_subsys()
6037 have_fork_callback |= (bool)ss->fork << ss->id; in cgroup_init_subsys()
6038 have_exit_callback |= (bool)ss->exit << ss->id; in cgroup_init_subsys()
6039 have_release_callback |= (bool)ss->release << ss->id; in cgroup_init_subsys()
6040 have_canfork_callback |= (bool)ss->can_fork << ss->id; in cgroup_init_subsys()
6061 struct cgroup_subsys *ss; in cgroup_init_early() local
6070 for_each_subsys(ss, i) { in cgroup_init_early()
6071 WARN(!ss->css_alloc || !ss->css_free || ss->name || ss->id, in cgroup_init_early()
6073 i, cgroup_subsys_name[i], ss->css_alloc, ss->css_free, in cgroup_init_early()
6074 ss->id, ss->name); in cgroup_init_early()
6078 ss->id = i; in cgroup_init_early()
6079 ss->name = cgroup_subsys_name[i]; in cgroup_init_early()
6080 if (!ss->legacy_name) in cgroup_init_early()
6081 ss->legacy_name = cgroup_subsys_name[i]; in cgroup_init_early()
6083 if (ss->early_init) in cgroup_init_early()
6084 cgroup_init_subsys(ss, true); in cgroup_init_early()
6097 struct cgroup_subsys *ss; in cgroup_init() local
6122 for_each_subsys(ss, ssid) { in cgroup_init()
6123 if (ss->early_init) { in cgroup_init()
6125 init_css_set.subsys[ss->id]; in cgroup_init()
6127 css->id = cgroup_idr_alloc(&ss->css_idr, css, 1, 2, in cgroup_init()
6131 cgroup_init_subsys(ss, false); in cgroup_init()
6147 ss->name); in cgroup_init()
6149 cgrp_dfl_root.subsys_mask |= 1 << ss->id; in cgroup_init()
6152 WARN_ON(ss->implicit_on_dfl && !ss->threaded); in cgroup_init()
6154 if (ss->implicit_on_dfl) in cgroup_init()
6155 cgrp_dfl_implicit_ss_mask |= 1 << ss->id; in cgroup_init()
6156 else if (!ss->dfl_cftypes) in cgroup_init()
6157 cgrp_dfl_inhibit_ss_mask |= 1 << ss->id; in cgroup_init()
6159 if (ss->threaded) in cgroup_init()
6160 cgrp_dfl_threaded_ss_mask |= 1 << ss->id; in cgroup_init()
6162 if (ss->dfl_cftypes == ss->legacy_cftypes) { in cgroup_init()
6163 WARN_ON(cgroup_add_cftypes(ss, ss->dfl_cftypes)); in cgroup_init()
6165 WARN_ON(cgroup_add_dfl_cftypes(ss, ss->dfl_cftypes)); in cgroup_init()
6166 WARN_ON(cgroup_add_legacy_cftypes(ss, ss->legacy_cftypes)); in cgroup_init()
6169 if (ss->bind) in cgroup_init()
6170 ss->bind(init_css_set.subsys[ssid]); in cgroup_init()
6283 struct cgroup_subsys *ss; in proc_cgroup_show() local
6292 for_each_subsys(ss, ssid) in proc_cgroup_show()
6295 ss->legacy_name); in proc_cgroup_show()
6546 struct cgroup_subsys *ss; in cgroup_can_fork() local
6553 do_each_subsys_mask(ss, i, have_canfork_callback) { in cgroup_can_fork()
6554 ret = ss->can_fork(child, kargs->cset); in cgroup_can_fork()
6562 for_each_subsys(ss, j) { in cgroup_can_fork()
6565 if (ss->cancel_fork) in cgroup_can_fork()
6566 ss->cancel_fork(child, kargs->cset); in cgroup_can_fork()
6586 struct cgroup_subsys *ss; in cgroup_cancel_fork() local
6589 for_each_subsys(ss, i) in cgroup_cancel_fork()
6590 if (ss->cancel_fork) in cgroup_cancel_fork()
6591 ss->cancel_fork(child, kargs->cset); in cgroup_cancel_fork()
6610 struct cgroup_subsys *ss; in cgroup_post_fork() local
6669 do_each_subsys_mask(ss, i, have_fork_callback) { in cgroup_post_fork()
6670 ss->fork(child); in cgroup_post_fork()
6698 struct cgroup_subsys *ss; in cgroup_exit() local
6721 do_each_subsys_mask(ss, i, have_exit_callback) { in cgroup_exit()
6722 ss->exit(tsk); in cgroup_exit()
6728 struct cgroup_subsys *ss; in cgroup_release() local
6731 do_each_subsys_mask(ss, ssid, have_release_callback) { in cgroup_release()
6732 ss->release(task); in cgroup_release()
6749 struct cgroup_subsys *ss; in cgroup_disable() local
6757 for_each_subsys(ss, i) { in cgroup_disable()
6758 if (strcmp(token, ss->name) && in cgroup_disable()
6759 strcmp(token, ss->legacy_name)) in cgroup_disable()
6764 ss->name); in cgroup_disable()
6800 struct cgroup_subsys *ss) in css_tryget_online_from_dir() argument
6821 css = cgroup_css(cgrp, ss); in css_tryget_online_from_dir()
6838 struct cgroup_subsys_state *css_from_id(int id, struct cgroup_subsys *ss) in css_from_id() argument
6841 return idr_find(&ss->css_idr, id); in css_from_id()
7052 struct cgroup_subsys *ss; in delegate_show() local
7062 for_each_subsys(ss, ssid) in delegate_show()
7063 ret += show_delegatable_files(ss->dfl_cftypes, buf + ret, in delegate_show()