Lines Matching +full:subsystem +full:- +full:level

1 /* SPDX-License-Identifier: GPL-2.0 */
8 * Copyright (C) 2004-2006 Silicon Graphics, Inc.
28 #include <linux/cgroup-defs.h>
66 struct list_head iters_node; /* css_set->task_iters */
85 * cgroup_subsys_enabled - fast test on whether a subsys is enabled
86 * @ss: subsystem in question
92 * cgroup_subsys_on_dfl - fast test on whether a subsys is on default hierarchy
93 * @ss: subsystem in question
163 * css_for_each_child - iterate through children of a css
169 * If a subsystem synchronizes ->css_online() and the start of iteration, a
170 * css which finished ->css_online() is guaranteed to be visible in the
172 * A css which hasn't finished ->css_online() or already finished
173 * ->css_offline() may show up during traversal. It's each subsystem's
185 * css_for_each_descendant_pre - pre-order walk of a css's descendants
192 * If a subsystem synchronizes ->css_online() and the start of iteration, a
193 * css which finished ->css_online() is guaranteed to be visible in the
195 * A css which hasn't finished ->css_online() or already finished
196 * ->css_offline() may show up during traversal. It's each subsystem's
222 * enclosed inside @pos locking, double-locking the parent isn't necessary
230 * iteration should lock and unlock both @pos->parent and @pos.
232 * Alternatively, a subsystem may choose to use a single global lock to
233 * synchronize ->css_online() and ->css_offline() against tree-walking
245 * css_for_each_descendant_post - post-order walk of a css's descendants
249 * Similar to css_for_each_descendant_pre() but performs post-order
253 * If a subsystem synchronizes ->css_online() and the start of iteration, a
254 * css which finished ->css_online() is guaranteed to be visible in the
256 * A css which hasn't finished ->css_online() or already finished
257 * ->css_offline() may show up during traversal. It's each subsystem's
260 * Note that the walk visibility guarantee example described in pre-order
261 * walk doesn't apply the same to post-order walks.
268 * cgroup_taskset_for_each - iterate cgroup_taskset
291 * cgroup_taskset_for_each_leader - iterate group leaders in a cgroup_taskset
296 * Iterate threadgroup leaders of @tset. For single-task migrations, @tset
303 if ((leader) != (leader)->group_leader) \
326 return cgrp->kn->id; in cgroup_id()
330 * css_is_dying - test whether the specified css is dying
334 * most cases, ->css_online() and ->css_offline() callbacks should be
346 return !(css->flags & CSS_NO_REF) && percpu_ref_is_dying(&css->refcnt); in css_is_dying()
351 css_get(&cgrp->self); in cgroup_get()
356 return css_tryget(&cgrp->self); in cgroup_tryget()
361 css_put(&cgrp->self); in cgroup_put()
377 * task_css_set_check - obtain a task's css_set with extra access conditions
391 rcu_dereference_check((task)->cgroups, \
395 ((task)->flags & PF_EXITING) || (__c))
398 rcu_dereference((task)->cgroups)
402 * task_css_check - obtain css for (task, subsys) w/ extra access conds
404 * @subsys_id: the target subsystem ID
411 task_css_set_check((task), (__c))->subsys[(subsys_id)]
414 * task_css_set - obtain a task's css_set
425 * task_css - obtain css for (task, subsys)
427 * @subsys_id: the target subsystem ID
438 * task_get_css - find and get the css for (task, subsys)
440 * @subsys_id: the target subsystem ID
469 * task_css_is_root - test whether a task belongs to the root css
471 * @subsys_id: the target subsystem ID
473 * Test whether @task belongs to the root css on the specified subsystem.
485 return task_css(task, subsys_id)->cgroup; in task_cgroup()
490 return task_css_set(task)->dfl_cgrp; in task_dfl_cgroup()
495 struct cgroup_subsys_state *parent_css = cgrp->self.parent; in cgroup_parent()
503 * cgroup_is_descendant - test ancestry
514 if (cgrp->root != ancestor->root || cgrp->level < ancestor->level) in cgroup_is_descendant()
516 return cgrp->ancestors[ancestor->level] == ancestor; in cgroup_is_descendant()
520 * cgroup_ancestor - find ancestor of cgroup
522 * @ancestor_level: level of ancestor to find starting from root
524 * Find ancestor of cgroup at specified level starting from root if it exists
533 if (ancestor_level < 0 || ancestor_level > cgrp->level) in cgroup_ancestor()
535 return cgrp->ancestors[ancestor_level]; in cgroup_ancestor()
539 * task_under_cgroup_hierarchy - test task's membership of cgroup ancestry
552 return cgroup_is_descendant(cset->dfl_cgrp, ancestor); in task_under_cgroup_hierarchy()
558 return cgrp->nr_populated_csets + cgrp->nr_populated_domain_children + in cgroup_is_populated()
559 cgrp->nr_populated_threaded_children; in cgroup_is_populated()
565 return kernfs_ino(cgrp->kn); in cgroup_ino()
568 /* cft/css accessors for cftype->write() operation */
571 return of->kn->priv; in of_cft()
576 /* cft/css accessors for cftype->seq_*() operations */
579 return of_cft(seq->private); in seq_cft()
584 return of_css(seq->private); in seq_css()
594 return kernfs_name(cgrp->kn, buf, buflen); in cgroup_name()
599 return kernfs_path(cgrp->kn, buf, buflen); in cgroup_path()
604 pr_cont_kernfs_name(cgrp->kn); in pr_cont_cgroup_name()
609 pr_cont_kernfs_path(cgrp->kn); in pr_cont_cgroup_path()
621 current->no_cgroup_migration = 1; in cgroup_init_kthreadd()
630 current->no_cgroup_migration = 0; in cgroup_kthread_ready()
648 struct dentry *dentry) { return -EINVAL; } in cgroupstats_build()
747 * sock->sk_cgrp_data handling. For more info, see sock_cgroup_data
748 * definition in cgroup-defs.h.
758 return skcd->cgroup; in sock_cgroup_ptr()
804 refcount_inc(&ns->ns.count); in get_cgroup_ns()
809 if (ns && refcount_dec_and_test(&ns->ns.count)) in put_cgroup_ns()
824 return task->frozen; in cgroup_task_frozen()
841 percpu_ref_get(&cgrp->bpf.refcnt); in cgroup_bpf_get()
846 percpu_ref_put(&cgrp->bpf.refcnt); in cgroup_bpf_put()