[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YTjk8oiFa5EfDPn9@slm.duckdns.org>
Date: Wed, 8 Sep 2021 06:29:38 -1000
From: Tejun Heo <tj@...nel.org>
To: Zhang Qiao <zhangqiao22@...wei.com>
Cc: linux-kernel@...r.kernel.org, juri.lelli@...hat.com,
mingo@...hat.com, peterz@...radead.org, vincent.guittot@...aro.org
Subject: Re: [PATCH] kernel/sched: Fix sched_fork() access an invalid
sched_task_group
Hello,
On Wed, Sep 08, 2021 at 07:32:06PM +0800, Zhang Qiao wrote:
> I will update this patch by following the steps below:
> 1)rename cgroup_subsys->fork() to cgroup_subsys->post_fork();
> 2)add cgroup_subsys->fork() and the cpu_cgroup_fork() callback like this:
>
> void cpu_cgroup_fork(struct task_struct *task) {
> ....
> p->sched_task_group = task_group(current);
> __set_task_cpu(p, smp_processor_id());
> if (p->sched_class->task_fork)
> p->sched_class->task_fork(p);
> ....
>
>
> 3)call cgroup_subsys->fork() after cgroup_can_fork().
>
> Do you have any suggestion?
I'm not following why it needs to shuffle the callbacks. Can't you just
relocate the fectching of task_group after can_fork?
Thanks.
--
tejun
Powered by blists - more mailing lists