diff options
author | Tejun Heo <tj@kernel.org> | 2015-11-20 15:55:52 -0500 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2015-11-20 15:55:52 -0500 |
commit | b11cfb5807e30333b36c02701382b820b7dcf0d5 (patch) | |
tree | aaa95e1c7d936e722fd3d9f9cbf72fe1b0890787 /fs/kernfs | |
parent | 8005c49d9aea74d382f474ce11afbbc7d7130bec (diff) | |
download | linux-b11cfb5807e30333b36c02701382b820b7dcf0d5.tar.gz linux-b11cfb5807e30333b36c02701382b820b7dcf0d5.tar.bz2 linux-b11cfb5807e30333b36c02701382b820b7dcf0d5.zip |
cgroup: record ancestor IDs and reimplement cgroup_is_descendant() using it
cgroup_is_descendant() currently walks up the hierarchy and compares
each ancestor to the cgroup in question. While enough for cgroup core
usages, this can't be used in hot paths to test cgroup membership.
This patch adds cgroup->ancestor_ids[] which records the IDs of all
ancestors including self and cgroup->level for the nesting level.
This allows testing whether a given cgroup is a descendant of another
in three finite steps - testing whether the two belong to the same
hierarchy, whether the descendant candidate is at the same or a higher
level than the ancestor and comparing the recorded ancestor_id at the
matching level. cgroup_is_descendant() is accordingly reimplmented
and made inline.
Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'fs/kernfs')
0 files changed, 0 insertions, 0 deletions