mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-20 13:41:30 +00:00
cgroup: distinguish local and children populated states
cgrp->populated_cnt counts both local (the cgroup's populated css_sets) and subtree proper (populated children) so that it's only zero when the whole subtree, including self, is empty. This patch splits the counter into two so that local and children populated states are tracked separately. It allows finer-grained tests on the state of the hierarchy which will be used to replace css_set walking local populated test. Signed-off-by: Tejun Heo <tj@kernel.org>
This commit is contained in:
parent
88e033e326
commit
788b950c62
3 changed files with 31 additions and 21 deletions
|
@ -263,11 +263,16 @@ struct cgroup {
|
|||
|
||||
/*
|
||||
* Each non-empty css_set associated with this cgroup contributes
|
||||
* one to populated_cnt. All children with non-zero popuplated_cnt
|
||||
* of their own contribute one. The count is zero iff there's no
|
||||
* task in this cgroup or its subtree.
|
||||
* one to nr_populated_csets. The counter is zero iff this cgroup
|
||||
* doesn't have any tasks.
|
||||
*
|
||||
* All children which have non-zero nr_populated_csets and/or
|
||||
* nr_populated_children of their own contribute one to
|
||||
* nr_populated_children. The counter is zero iff this cgroup's
|
||||
* subtree proper doesn't have any tasks.
|
||||
*/
|
||||
int populated_cnt;
|
||||
int nr_populated_csets;
|
||||
int nr_populated_children;
|
||||
|
||||
struct kernfs_node *kn; /* cgroup kernfs entry */
|
||||
struct cgroup_file procs_file; /* handle for "cgroup.procs" */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue