Lines Matching defs:cgrp

209 void cgroup1_pidlist_destroy_all(struct cgroup *cgrp)
213 mutex_lock(&cgrp->pidlist_mutex);
214 list_for_each_entry_safe(l, tmp_l, &cgrp->pidlists, links)
216 mutex_unlock(&cgrp->pidlist_mutex);
219 BUG_ON(!list_empty(&cgrp->pidlists));
291 static struct cgroup_pidlist *cgroup_pidlist_find(struct cgroup *cgrp, enum cgroup_filetype type)
297 lockdep_assert_held(&cgrp->pidlist_mutex);
299 list_for_each_entry(l, &cgrp->pidlists, links) if (l->key.type == type && l->key.ns == ns) return l;
309 static struct cgroup_pidlist *cgroup_pidlist_find_create(struct cgroup *cgrp, enum cgroup_filetype type)
313 lockdep_assert_held(&cgrp->pidlist_mutex);
315 l = cgroup_pidlist_find(cgrp, type);
330 l->owner = cgrp;
331 list_add(&l->links, &cgrp->pidlists);
338 static int pidlist_array_load(struct cgroup *cgrp, enum cgroup_filetype type, struct cgroup_pidlist **lp)
347 lockdep_assert_held(&cgrp->pidlist_mutex);
355 length = cgroup_task_count(cgrp);
361 css_task_iter_start(&cgrp->self, 0, &it);
384 l = cgroup_pidlist_find_create(cgrp, type);
414 struct cgroup *cgrp = seq_css(s)->cgroup;
420 mutex_lock(&cgrp->pidlist_mutex);
429 ctx->procs1.pidlist = cgroup_pidlist_find(cgrp, type);
437 ret = pidlist_array_load(cgrp, type, &ctx->procs1.pidlist);
512 struct cgroup *cgrp;
518 cgrp = cgroup_kn_lock_live(of->kn, false);
519 if (!cgrp) {
549 ret = cgroup_attach_task(cgrp, task, threadgroup);
571 struct cgroup *cgrp;
574 BUILD_BUG_ON(sizeof(cgrp->root->release_agent_path) < PATH_MAX);
585 cgrp = cgroup_kn_lock_live(of->kn, false);
586 if (!cgrp) {
590 strlcpy(cgrp->root->release_agent_path, strstrip(buf), sizeof(cgrp->root->release_agent_path));
598 struct cgroup *cgrp = seq_css(seq)->cgroup;
601 seq_puts(seq, cgrp->root->release_agent_path);
705 dead = percpu_ref_is_dying(&ss->root->cgrp.self.refcnt);
726 struct cgroup *cgrp;
743 cgrp = rcu_dereference(*(void __rcu __force **)&kn->priv);
744 if (!cgrp || cgroup_is_dead(cgrp)) {
751 css_task_iter_start(&cgrp->self, 0, &it);
779 void cgroup1_check_for_release(struct cgroup *cgrp)
781 if (notify_on_release(cgrp) && !cgroup_is_populated(cgrp) && !css_has_online_children(&cgrp->self) &&
782 !cgroup_is_dead(cgrp)) {
783 schedule_work(&cgrp->release_agent_work);
812 struct cgroup *cgrp = container_of(work, struct cgroup, release_agent_work);
818 if (!cgrp->root->release_agent_path[0]) {
830 strlcpy(agentbuf, cgrp->root->release_agent_path, PATH_MAX);
836 ret = cgroup_path_ns(cgrp, pathbuf, PATH_MAX, &init_cgroup_ns);
861 struct cgroup *cgrp = kn->priv;
888 TRACE_CGROUP_PATH(rename, cgrp);
921 if (test_bit(CGRP_CPUSET_CLONE_CHILDREN, &root->cgrp.flags)) {
1119 cgroup_lock_and_drain_offline(&cgrp_dfl_root.cgrp);
1143 if (!list_empty(&root->cgrp.self.children)) {
1210 if (!percpu_ref_tryget_live(&ss->root->cgrp.self.refcnt)) {
1213 cgroup_put(&ss->root->cgrp);
1294 cgroup_lock_and_drain_offline(&cgrp_dfl_root.cgrp);
1297 if (!ret && !percpu_ref_tryget_live(&ctx->root->cgrp.self.refcnt)) {
1307 if (!ret && percpu_ref_is_dying(&ctx->root->cgrp.self.refcnt)) {