Lines Matching refs:cgrp

212 void cgroup1_pidlist_destroy_all(struct cgroup *cgrp)  in cgroup1_pidlist_destroy_all()  argument
216 mutex_lock(&cgrp->pidlist_mutex); in cgroup1_pidlist_destroy_all()
217 list_for_each_entry_safe(l, tmp_l, &cgrp->pidlists, links) in cgroup1_pidlist_destroy_all()
219 mutex_unlock(&cgrp->pidlist_mutex); in cgroup1_pidlist_destroy_all()
222 BUG_ON(!list_empty(&cgrp->pidlists)); in cgroup1_pidlist_destroy_all()
293 static struct cgroup_pidlist *cgroup_pidlist_find(struct cgroup *cgrp, in cgroup_pidlist_find() argument
300 lockdep_assert_held(&cgrp->pidlist_mutex); in cgroup_pidlist_find()
302 list_for_each_entry(l, &cgrp->pidlists, links) in cgroup_pidlist_find()
314 static struct cgroup_pidlist *cgroup_pidlist_find_create(struct cgroup *cgrp, in cgroup_pidlist_find_create() argument
319 lockdep_assert_held(&cgrp->pidlist_mutex); in cgroup_pidlist_find_create()
321 l = cgroup_pidlist_find(cgrp, type); in cgroup_pidlist_find_create()
334 l->owner = cgrp; in cgroup_pidlist_find_create()
335 list_add(&l->links, &cgrp->pidlists); in cgroup_pidlist_find_create()
343 int cgroup_task_count(const struct cgroup *cgrp) in cgroup_task_count() argument
349 list_for_each_entry(link, &cgrp->cset_links, cset_link) in cgroup_task_count()
358 static int pidlist_array_load(struct cgroup *cgrp, enum cgroup_filetype type, in pidlist_array_load() argument
368 lockdep_assert_held(&cgrp->pidlist_mutex); in pidlist_array_load()
376 length = cgroup_task_count(cgrp); in pidlist_array_load()
381 css_task_iter_start(&cgrp->self, 0, &it); in pidlist_array_load()
400 l = cgroup_pidlist_find_create(cgrp, type); in pidlist_array_load()
429 struct cgroup *cgrp = seq_css(s)->cgroup; in cgroup_pidlist_start() local
435 mutex_lock(&cgrp->pidlist_mutex); in cgroup_pidlist_start()
444 of->priv = cgroup_pidlist_find(cgrp, type); in cgroup_pidlist_start()
451 ret = pidlist_array_load(cgrp, type, in cgroup_pidlist_start()
522 struct cgroup *cgrp; in __cgroup1_procs_write() local
527 cgrp = cgroup_kn_lock_live(of->kn, false); in __cgroup1_procs_write()
528 if (!cgrp) in __cgroup1_procs_write()
550 ret = cgroup_attach_task(cgrp, task, threadgroup); in __cgroup1_procs_write()
575 struct cgroup *cgrp; in cgroup_release_agent_write() local
577 BUILD_BUG_ON(sizeof(cgrp->root->release_agent_path) < PATH_MAX); in cgroup_release_agent_write()
579 cgrp = cgroup_kn_lock_live(of->kn, false); in cgroup_release_agent_write()
580 if (!cgrp) in cgroup_release_agent_write()
583 strlcpy(cgrp->root->release_agent_path, strstrip(buf), in cgroup_release_agent_write()
584 sizeof(cgrp->root->release_agent_path)); in cgroup_release_agent_write()
592 struct cgroup *cgrp = seq_css(seq)->cgroup; in cgroup_release_agent_show() local
595 seq_puts(seq, cgrp->root->release_agent_path); in cgroup_release_agent_show()
720 struct cgroup *cgrp; in cgroupstats_build() local
737 cgrp = rcu_dereference(*(void __rcu __force **)&kn->priv); in cgroupstats_build()
738 if (!cgrp || cgroup_is_dead(cgrp)) { in cgroupstats_build()
745 css_task_iter_start(&cgrp->self, 0, &it); in cgroupstats_build()
772 void cgroup1_check_for_release(struct cgroup *cgrp) in cgroup1_check_for_release() argument
774 if (notify_on_release(cgrp) && !cgroup_is_populated(cgrp) && in cgroup1_check_for_release()
775 !css_has_online_children(&cgrp->self) && !cgroup_is_dead(cgrp)) in cgroup1_check_for_release()
776 schedule_work(&cgrp->release_agent_work); in cgroup1_check_for_release()
804 struct cgroup *cgrp = in cgroup1_release_agent() local
813 agentbuf = kstrdup(cgrp->root->release_agent_path, GFP_KERNEL); in cgroup1_release_agent()
818 ret = cgroup_path_ns_locked(cgrp, pathbuf, PATH_MAX, &init_cgroup_ns); in cgroup1_release_agent()
848 struct cgroup *cgrp = kn->priv; in cgroup1_rename() local
868 TRACE_CGROUP_PATH(rename, cgrp); in cgroup1_rename()
899 if (test_bit(CGRP_CPUSET_CLONE_CHILDREN, &root->cgrp.flags)) in cgroup1_show_options()
1049 cgroup_lock_and_drain_offline(&cgrp_dfl_root.cgrp); in cgroup1_remount()
1073 if (!list_empty(&root->cgrp.self.children)) { in cgroup1_remount()
1120 cgroup_lock_and_drain_offline(&cgrp_dfl_root.cgrp); in cgroup1_mount()
1139 if (!percpu_ref_tryget_live(&ss->root->cgrp.self.refcnt)) { in cgroup1_mount()
1145 cgroup_put(&ss->root->cgrp); in cgroup1_mount()
1194 !percpu_ref_tryget_live(&root->cgrp.self.refcnt)) { in cgroup1_mount()
1256 percpu_ref_reinit(&root->cgrp.self.refcnt); in cgroup1_mount()