Re: [PATCH v3 bpf-next 03/11] cgroup: Eliminate the need for cgroup_mutex in proc_cgroup_show()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Oct 29, 2023 at 06:14:30AM +0000, Yafang Shao wrote:
> The cgroup root_list is already RCU-safe. Therefore, we can replace the
> cgroup_mutex with the RCU read lock in some particular paths. This change
> will be particularly beneficial for frequent operations, such as
> `cat /proc/self/cgroup`, in a cgroup1-based container environment.
> 
> I did stress tests with this change, as outlined below
> (with CONFIG_PROVE_RCU_LIST enabled):
> 
> - Continuously mounting and unmounting named cgroups in some tasks,
>   for example:
> 
>   cgrp_name=$1
>   while true
>   do
>       mount -t cgroup -o none,name=$cgrp_name none /$cgrp_name
>       umount /$cgrp_name
>   done
> 
> - Continuously triggering proc_cgroup_show() in some tasks concurrently,
>   for example:
>   while true; do cat /proc/self/cgroup > /dev/null; done
> 
> They can ran successfully after implementing this change, with no RCU
> warnings in dmesg.
> 
> Signed-off-by: Yafang Shao <laoar.shao@xxxxxxxxx>

Acked-by: Tejun Heo <tj@xxxxxxxxxx>

Thanks.

-- 
tejun




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux