diff options
author | Roman Gushchin <guro@fb.com> | 2019-04-19 19:03:03 +0200 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2019-04-19 20:26:48 +0200 |
commit | 4dcabece4c3a9f9522127be12cc12cc120399b2f (patch) | |
tree | 0d985b3d1232ff76e67a0ac07213e4c8e4ab4a7b /kernel/Kconfig.hz | |
parent | cgroup: implement __cgroup_task_count() helper (diff) | |
download | linux-4dcabece4c3a9f9522127be12cc12cc120399b2f.tar.xz linux-4dcabece4c3a9f9522127be12cc12cc120399b2f.zip |
cgroup: protect cgroup->nr_(dying_)descendants by css_set_lock
The number of descendant cgroups and the number of dying
descendant cgroups are currently synchronized using the cgroup_mutex.
The number of descendant cgroups will be required by the cgroup v2
freezer, which will use it to determine if a cgroup is frozen
(depending on total number of descendants and number of frozen
descendants). It's not always acceptable to grab the cgroup_mutex,
especially from quite hot paths (e.g. exit()).
To avoid this, let's additionally synchronize these counters using
the css_set_lock.
So, it's safe to read these counters with either cgroup_mutex or
css_set_lock locked, and for changing both locks should be acquired.
Signed-off-by: Roman Gushchin <guro@fb.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: kernel-team@fb.com
Diffstat (limited to 'kernel/Kconfig.hz')
0 files changed, 0 insertions, 0 deletions