Lines Matching refs:cgrp
202 void cgroup1_pidlist_destroy_all(struct cgroup *cgrp) in cgroup1_pidlist_destroy_all() argument
206 mutex_lock(&cgrp->pidlist_mutex); in cgroup1_pidlist_destroy_all()
207 list_for_each_entry_safe(l, tmp_l, &cgrp->pidlists, links) in cgroup1_pidlist_destroy_all()
209 mutex_unlock(&cgrp->pidlist_mutex); in cgroup1_pidlist_destroy_all()
212 BUG_ON(!list_empty(&cgrp->pidlists)); in cgroup1_pidlist_destroy_all()
283 static struct cgroup_pidlist *cgroup_pidlist_find(struct cgroup *cgrp, in cgroup_pidlist_find() argument
290 lockdep_assert_held(&cgrp->pidlist_mutex); in cgroup_pidlist_find()
292 list_for_each_entry(l, &cgrp->pidlists, links) in cgroup_pidlist_find()
304 static struct cgroup_pidlist *cgroup_pidlist_find_create(struct cgroup *cgrp, in cgroup_pidlist_find_create() argument
309 lockdep_assert_held(&cgrp->pidlist_mutex); in cgroup_pidlist_find_create()
311 l = cgroup_pidlist_find(cgrp, type); in cgroup_pidlist_find_create()
324 l->owner = cgrp; in cgroup_pidlist_find_create()
325 list_add(&l->links, &cgrp->pidlists); in cgroup_pidlist_find_create()
332 static int pidlist_array_load(struct cgroup *cgrp, enum cgroup_filetype type, in pidlist_array_load() argument
342 lockdep_assert_held(&cgrp->pidlist_mutex); in pidlist_array_load()
350 length = cgroup_task_count(cgrp); in pidlist_array_load()
355 css_task_iter_start(&cgrp->self, 0, &it); in pidlist_array_load()
373 l = cgroup_pidlist_find_create(cgrp, type); in pidlist_array_load()
403 struct cgroup *cgrp = seq_css(s)->cgroup; in cgroup_pidlist_start() local
409 mutex_lock(&cgrp->pidlist_mutex); in cgroup_pidlist_start()
418 ctx->procs1.pidlist = cgroup_pidlist_find(cgrp, type); in cgroup_pidlist_start()
425 ret = pidlist_array_load(cgrp, type, &ctx->procs1.pidlist); in cgroup_pidlist_start()
498 struct cgroup *cgrp; in __cgroup1_procs_write() local
504 cgrp = cgroup_kn_lock_live(of->kn, false); in __cgroup1_procs_write()
505 if (!cgrp) in __cgroup1_procs_write()
528 ret = cgroup_attach_task(cgrp, task, threadgroup); in __cgroup1_procs_write()
553 struct cgroup *cgrp; in cgroup_release_agent_write() local
556 BUILD_BUG_ON(sizeof(cgrp->root->release_agent_path) < PATH_MAX); in cgroup_release_agent_write()
567 cgrp = cgroup_kn_lock_live(of->kn, false); in cgroup_release_agent_write()
568 if (!cgrp) in cgroup_release_agent_write()
571 strscpy(cgrp->root->release_agent_path, strstrip(buf), in cgroup_release_agent_write()
572 sizeof(cgrp->root->release_agent_path)); in cgroup_release_agent_write()
580 struct cgroup *cgrp = seq_css(seq)->cgroup; in cgroup_release_agent_show() local
583 seq_puts(seq, cgrp->root->release_agent_path); in cgroup_release_agent_show()
710 struct cgroup *cgrp; in cgroupstats_build() local
725 cgrp = rcu_dereference(*(void __rcu __force **)&kn->priv); in cgroupstats_build()
726 if (!cgrp || !cgroup_tryget(cgrp)) { in cgroupstats_build()
732 css_task_iter_start(&cgrp->self, 0, &it); in cgroupstats_build()
755 cgroup_put(cgrp); in cgroupstats_build()
759 void cgroup1_check_for_release(struct cgroup *cgrp) in cgroup1_check_for_release() argument
761 if (notify_on_release(cgrp) && !cgroup_is_populated(cgrp) && in cgroup1_check_for_release()
762 !css_has_online_children(&cgrp->self) && !cgroup_is_dead(cgrp)) in cgroup1_check_for_release()
763 schedule_work(&cgrp->release_agent_work); in cgroup1_check_for_release()
791 struct cgroup *cgrp = in cgroup1_release_agent() local
798 if (!cgrp->root->release_agent_path[0]) in cgroup1_release_agent()
808 strscpy(agentbuf, cgrp->root->release_agent_path, PATH_MAX); in cgroup1_release_agent()
813 ret = cgroup_path_ns(cgrp, pathbuf, PATH_MAX, &init_cgroup_ns); in cgroup1_release_agent()
838 struct cgroup *cgrp = kn->priv; in cgroup1_rename() local
862 TRACE_CGROUP_PATH(rename, cgrp); in cgroup1_rename()
895 if (test_bit(CGRP_CPUSET_CLONE_CHILDREN, &root->cgrp.flags)) in cgroup1_show_options()
1088 cgroup_lock_and_drain_offline(&cgrp_dfl_root.cgrp); in cgroup1_reconfigure()
1112 if (!list_empty(&root->cgrp.self.children)) { in cgroup1_reconfigure()
1176 if (!percpu_ref_tryget_live(&ss->root->cgrp.self.refcnt)) in cgroup1_root_to_use()
1178 cgroup_put(&ss->root->cgrp); in cgroup1_root_to_use()
1253 cgroup_lock_and_drain_offline(&cgrp_dfl_root.cgrp); in cgroup1_get_tree()
1256 if (!ret && !percpu_ref_tryget_live(&ctx->root->cgrp.self.refcnt)) in cgroup1_get_tree()
1264 if (!ret && percpu_ref_is_dying(&ctx->root->cgrp.self.refcnt)) { in cgroup1_get_tree()
1288 struct cgroup *cgrp = ERR_PTR(-ENOENT); in task_get_cgroup1() local
1300 cgrp = task_cgroup_from_root(tsk, root); in task_get_cgroup1()
1301 if (!cgrp || !cgroup_tryget(cgrp)) in task_get_cgroup1()
1302 cgrp = ERR_PTR(-ENOENT); in task_get_cgroup1()
1307 return cgrp; in task_get_cgroup1()