]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
cgroup: Update out-of-date comment in cgroup_migrate()
authorXiu Jianfeng <xiujianfeng@huaweicloud.com>
Wed, 24 May 2023 06:54:31 +0000 (14:54 +0800)
committerTejun Heo <tj@kernel.org>
Wed, 24 May 2023 22:22:07 +0000 (12:22 -1000)
Commit 674b745e22b3 ("cgroup: remove rcu_read_lock()/rcu_read_unlock()
in critical section of spin_lock_irq()") has removed the rcu_read_lock,
which makes the comment out-of-date, so update it.

tj: Updated the comment a bit.

Signed-off-by: Xiu Jianfeng <xiujianfeng@huawei.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
kernel/cgroup/cgroup.c

index 9d809191a54f1e9c86cd1fc05ba11a89372ac005..f329f49529a2c51afdc4ddee92a8a2743d782866 100644 (file)
@@ -2872,9 +2872,9 @@ int cgroup_migrate(struct task_struct *leader, bool threadgroup,
        struct task_struct *task;
 
        /*
-        * Prevent freeing of tasks while we take a snapshot. Tasks that are
-        * already PF_EXITING could be freed from underneath us unless we
-        * take an rcu_read_lock.
+        * The following thread iteration should be inside an RCU critical
+        * section to prevent tasks from being freed while taking the snapshot.
+        * spin_lock_irq() implies RCU critical section here.
         */
        spin_lock_irq(&css_set_lock);
        task = leader;