Commit 92f6ebea authored by Yafang Shao's avatar Yafang Shao Committed by Greg Kroah-Hartman
Browse files

cgroup: Make operations on the cgroup root_list RCU safe



commit d23b5c57 upstream.

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: default avatarYafang Shao <laoar.shao@gmail.com>
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
[fp: adapt to 5.10 mainly because of changes made by e210a89f
 ("cgroup.c: add helper __cset_cgroup_from_root to cleanup duplicated
 codes")]
Signed-off-by: default avatarFedor Pchelkin <pchelkin@ispras.ru>
[Shivani: Modified to apply on v5.4.y]
Signed-off-by: default avatarShivani Agarwal <shivani.agarwal@broadcom.com>
Reviewed-by: default avatarSiddh Raman Pant <siddh.raman.pant@oracle.com>
Signed-off-by: default avatarSiddh Raman Pant <siddh.raman.pant@oracle.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a35767ab
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment