diff options
author | Yafang Shao <laoar.shao@gmail.com> | 2023-10-29 09:14:29 +0300 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2023-11-10 02:25:47 +0300 |
commit | d23b5c577715892c87533b13923306acc6243f93 (patch) | |
tree | 34dd5580faefac6cad9daf46e27e471d0166a60c /include/linux/cgroup-defs.h | |
parent | 96a2b48e5e1df6698f504969f0f51dc34e52ff3d (diff) | |
download | linux-d23b5c577715892c87533b13923306acc6243f93.tar.xz |
cgroup: Make operations on the cgroup root_list RCU safe
At present, when we perform operations on the cgroup root_list, we must
hold the cgroup_mutex, which is a relatively heavyweight lock. In reality,
we can make operations on this list RCU-safe, eliminating the need to hold
the cgroup_mutex during traversal. Modifications to the list only occur in
the cgroup root setup and destroy paths, which should be infrequent in a
production environment. In contrast, traversal may occur frequently.
Therefore, making it RCU-safe would be beneficial.
Signed-off-by: Yafang Shao <laoar.shao@gmail.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'include/linux/cgroup-defs.h')
-rw-r--r-- | include/linux/cgroup-defs.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/cgroup-defs.h b/include/linux/cgroup-defs.h index 4a6b6b77ccb6..4caab0c6b361 100644 --- a/include/linux/cgroup-defs.h +++ b/include/linux/cgroup-defs.h @@ -563,6 +563,7 @@ struct cgroup_root { /* A list running through the active hierarchies */ struct list_head root_list; + struct rcu_head rcu; /* Hierarchy-specific flags */ unsigned int flags; |