Lines Matching +full:pk +full:- +full:pk
1 // SPDX-License-Identifier: GPL-2.0
12 #include "cgroup-internal.h"
20 return ERR_PTR(-ENOMEM); in debug_css_alloc()
31 * debug_taskcount_read - return the number of tasks in a cgroup.
37 return cgroup_task_count(css->cgroup); in debug_taskcount_read()
42 struct kernfs_open_file *of = seq->private; in current_css_set_read()
48 if (!cgroup_kn_lock_live(of->kn, false)) in current_css_set_read()
49 return -ENODEV; in current_css_set_read()
54 refcnt = refcount_read(&cset->refcount); in current_css_set_read()
55 seq_printf(seq, "css_set %pK %d", cset, refcnt); in current_css_set_read()
56 if (refcnt > cset->nr_tasks) in current_css_set_read()
57 seq_printf(seq, " +%d", refcnt - cset->nr_tasks); in current_css_set_read()
64 css = cset->subsys[ss->id]; in current_css_set_read()
67 seq_printf(seq, "%2d: %-4s\t- %p[%d]\n", ss->id, ss->name, in current_css_set_read()
68 css, css->id); in current_css_set_read()
72 cgroup_kn_unlock(of->kn); in current_css_set_read()
82 count = refcount_read(&task_css_set(current)->refcount); in current_css_set_refcount_read()
95 return -ENOMEM; in current_css_set_cg_links_read()
100 list_for_each_entry(link, &cset->cgrp_links, cgrp_link) { in current_css_set_cg_links_read()
101 struct cgroup *c = link->cgrp; in current_css_set_cg_links_read()
105 c->root->hierarchy_id, name_buf); in current_css_set_cg_links_read()
122 list_for_each_entry(link, &css->cgroup->cset_links, cset_link) { in cgroup_css_links_read()
123 struct css_set *cset = link->cset; in cgroup_css_links_read()
126 int refcnt = refcount_read(&cset->refcount); in cgroup_css_links_read()
132 seq_printf(seq, "css_set %pK", cset); in cgroup_css_links_read()
133 if (rcu_dereference_protected(cset->dom_cset, 1) != cset) { in cgroup_css_links_read()
135 seq_printf(seq, "=>%pK", cset->dom_cset); in cgroup_css_links_read()
137 if (!list_empty(&cset->threaded_csets)) { in cgroup_css_links_read()
141 list_for_each_entry(tcset, &cset->threaded_csets, in cgroup_css_links_read()
144 seq_printf(seq, "%pK", tcset); in cgroup_css_links_read()
149 if (refcnt - cset->nr_tasks > 0) { in cgroup_css_links_read()
150 int extra = refcnt - cset->nr_tasks; in cgroup_css_links_read()
158 extra--; in cgroup_css_links_read()
164 list_for_each_entry(task, &cset->tasks, cg_list) { in cgroup_css_links_read()
170 list_for_each_entry(task, &cset->mg_tasks, cg_list) { in cgroup_css_links_read()
178 count - MAX_TASKS_SHOWN_PER_CSS); in cgroup_css_links_read()
180 if (cset->dead) { in cgroup_css_links_read()
185 WARN_ON(count != cset->nr_tasks); in cgroup_css_links_read()
205 struct kernfs_open_file *of = seq->private; in cgroup_subsys_states_read()
212 cgrp = cgroup_kn_lock_live(of->kn, false); in cgroup_subsys_states_read()
214 return -ENODEV; in cgroup_subsys_states_read()
217 css = rcu_dereference_check(cgrp->subsys[ss->id], true); in cgroup_subsys_states_read()
224 if (css->parent) in cgroup_subsys_states_read()
225 snprintf(pbuf, sizeof(pbuf) - 1, " P=%d", in cgroup_subsys_states_read()
226 css->parent->id); in cgroup_subsys_states_read()
227 seq_printf(seq, "%2d: %-4s\t- %p[%d] %d%s\n", ss->id, ss->name, in cgroup_subsys_states_read()
228 css, css->id, in cgroup_subsys_states_read()
229 atomic_read(&css->online_cnt), pbuf); in cgroup_subsys_states_read()
232 cgroup_kn_unlock(of->kn); in cgroup_subsys_states_read()
243 seq_printf(seq, "%-17s: ", name); in cgroup_masks_read_one()
249 seq_puts(seq, ss->name); in cgroup_masks_read_one()
257 struct kernfs_open_file *of = seq->private; in cgroup_masks_read()
260 cgrp = cgroup_kn_lock_live(of->kn, false); in cgroup_masks_read()
262 return -ENODEV; in cgroup_masks_read()
264 cgroup_masks_read_one(seq, "subtree_control", cgrp->subtree_control); in cgroup_masks_read()
265 cgroup_masks_read_one(seq, "subtree_ss_mask", cgrp->subtree_ss_mask); in cgroup_masks_read()
267 cgroup_kn_unlock(of->kn); in cgroup_masks_read()
273 return (!cgroup_is_populated(css->cgroup) && in releasable_read()
274 !css_has_online_children(&css->cgroup->self)); in releasable_read()