* [PATCH -next] cgroup: Remove out-of-date comment in cgroup_migrate()
@ 2023-05-23 11:14 Xiu Jianfeng
2023-05-23 19:09 ` Tejun Heo
0 siblings, 1 reply; 3+ messages in thread
From: Xiu Jianfeng @ 2023-05-23 11:14 UTC (permalink / raw)
To: tj, lizefan.x, hannes; +Cc: cgroups, linux-kernel, xiujianfeng
From: Xiu Jianfeng <xiujianfeng@huawei.com>
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 remove it.
Signed-off-by: Xiu Jianfeng <xiujianfeng@huawei.com>
---
kernel/cgroup/cgroup.c | 5 -----
1 file changed, 5 deletions(-)
diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c
index d8ba2c67910d..415d51c713ad 100644
--- a/kernel/cgroup/cgroup.c
+++ b/kernel/cgroup/cgroup.c
@@ -2871,11 +2871,6 @@ 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.
- */
spin_lock_irq(&css_set_lock);
task = leader;
do {
--
2.17.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH -next] cgroup: Remove out-of-date comment in cgroup_migrate()
2023-05-23 11:14 [PATCH -next] cgroup: Remove out-of-date comment in cgroup_migrate() Xiu Jianfeng
@ 2023-05-23 19:09 ` Tejun Heo
2023-05-24 6:57 ` Xiu Jianfeng
0 siblings, 1 reply; 3+ messages in thread
From: Tejun Heo @ 2023-05-23 19:09 UTC (permalink / raw)
To: Xiu Jianfeng; +Cc: lizefan.x, hannes, cgroups, linux-kernel
On Tue, May 23, 2023 at 07:14:56PM +0800, Xiu Jianfeng wrote:
> From: Xiu Jianfeng <xiujianfeng@huawei.com>
>
> 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 remove it.
>
> Signed-off-by: Xiu Jianfeng <xiujianfeng@huawei.com>
So, that removed rcu_read_lock() because it's implied by the irq disable but
the comment content is still useful in describing what's preventing
use-after-free. Can you please update the comment accordingly instead?
Thanks.
--
tejun
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH -next] cgroup: Remove out-of-date comment in cgroup_migrate()
2023-05-23 19:09 ` Tejun Heo
@ 2023-05-24 6:57 ` Xiu Jianfeng
0 siblings, 0 replies; 3+ messages in thread
From: Xiu Jianfeng @ 2023-05-24 6:57 UTC (permalink / raw)
To: Tejun Heo; +Cc: lizefan.x, hannes, cgroups, linux-kernel
On 2023/5/24 3:09, Tejun Heo wrote:
> On Tue, May 23, 2023 at 07:14:56PM +0800, Xiu Jianfeng wrote:
>> From: Xiu Jianfeng <xiujianfeng@huawei.com>
>>
>> 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 remove it.
>>
>> Signed-off-by: Xiu Jianfeng <xiujianfeng@huawei.com>
>
> So, that removed rcu_read_lock() because it's implied by the irq disable but
> the comment content is still useful in describing what's preventing
> use-after-free. Can you please update the comment accordingly instead?
sure, I would send a v2.
>
> Thanks.
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-05-24 6:58 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-23 11:14 [PATCH -next] cgroup: Remove out-of-date comment in cgroup_migrate() Xiu Jianfeng
2023-05-23 19:09 ` Tejun Heo
2023-05-24 6:57 ` Xiu Jianfeng
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).