linux/kernel/cgroup
Roman Gushchin 4dcabece4c 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
2019-04-19 11:26:48 -07:00
..
cgroup-internal.h cgroup: implement __cgroup_task_count() helper 2019-04-19 11:26:48 -07:00
cgroup-v1.c cgroup: implement __cgroup_task_count() helper 2019-04-19 11:26:48 -07:00
cgroup.c cgroup: protect cgroup->nr_(dying_)descendants by css_set_lock 2019-04-19 11:26:48 -07:00
cpuset.c Merge branch 'work.mount' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2019-03-12 14:08:19 -07:00
debug.c cpuset: Expose cpuset.cpus.subpartitions with cgroup_debug 2018-11-08 12:27:32 -08:00
legacy_freezer.c cgroup: rename freezer.c into legacy_freezer.c 2019-04-19 11:26:48 -07:00
Makefile cgroup: rename freezer.c into legacy_freezer.c 2019-04-19 11:26:48 -07:00
namespace.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
pids.c cgroup/pids: turn cgroup_subsys->free() into cgroup_subsys->release() to fix the accounting 2019-01-31 06:55:57 -08:00
rdma.c IB/core: Simplify rdma cgroup registration 2019-01-18 13:43:10 -07:00
rstat.c cgroup, rstat: Don't flush subtree root unless necessary 2019-02-15 11:01:31 -08:00