When using CLONE_INTO_CGROUP, there is no need to write cgroup.procs. So although
On 2025/9/4 4:45, Tejun Heo wrote:
Hello, Michal.I'm still a bit confused. Commit 671c11f0619e ("cgroup: Elide write-locking threadgroup_rwsem when
On Wed, Sep 03, 2025 at 10:03:39PM +0200, Michal Koutný wrote:
On Wed, Sep 03, 2025 at 06:53:36AM -1000, Tejun Heo <tj@xxxxxxxxxx> wrote:Sorry, I was confused. We no longer need to write lock threadgroup rwsem
If you use CLONE_INTO_CGROUP, cgroup migration doesn't just become cold. ItCLONE_INTO_CGROUP uses cgroup_mutex and threadgroup rwsem like regular
disappears completely and CLONE_INTO_CGROUP doesn't need any global locks
from cgroup side.
migration, no? Its effect is atomicity wrt clone.
Or, Tejum, what do you mean that it disappears? (I think we cannot give
up cgroup_mutex as it ensures synchronization of possible parent's
migration.)
when CLONE_INTO_CGROUP'ing into an empty cgroup. We do still need
cgroup_mutex.
671c11f0619e ("cgroup: Elide write-locking threadgroup_rwsem when updating csses on an empty subtree")
Thanks.
updating csses on an empty subtree") only applies to CSS updates. However, cloning with
CLONE_INTO_CGROUP still requires acquiring the threadgroup_rwsem.
cgroup_can_fork
cgroup_css_set_fork
if (kargs->flags & CLONE_INTO_CGROUP)
cgroup_lock();
cgroup_threadgroup_change_begin(current);