[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b30205b0-bf54-7255-fc1c-9dfa5dbb4940@huawei.com>
Date: Tue, 14 Sep 2021 16:20:02 +0800
From: Zhang Qiao <zhangqiao22@...wei.com>
To: Tejun Heo <tj@...nel.org>
CC: <mingo@...hat.com>, <peterz@...radead.org>,
<linux-kernel@...r.kernel.org>, <juri.lelli@...hat.com>,
<vincent.guittot@...aro.org>, <dietmar.eggemann@....com>,
<rostedt@...dmis.org>, <bsegall@...gle.com>, <mgorman@...e.de>,
<bristot@...hat.com>
Subject: Re: [PATCH v2] kernel/sched: Fix sched_fork() access an invalid
sched_task_group
在 2021/9/14 2:01, Tejun Heo 写道:
> Hello,
>
> On Sat, Sep 11, 2021 at 03:50:54PM +0800, Zhang Qiao wrote:
>> Between cgroup_can_fork() and cgroup_post_fork(), the cgroup
>> membership is fixed and thus sched_task_group can't change. So
>> call sched_fork() after cgroup_can_fork() and update the child's
>> sched_task_group before it is used.
>
> The part being fixed looks correct to me but it's difficult to for me to
> assess whether the whole relocation of the sched_fork() hook doesn't change
Indeed is this, although I checked and tested it many times.
> anything else. Besides, even if we decide to relocate the sched_fork hook, I
> think it'd be better to separate the two changes - one is a relatively safe
> bug fix, the other is a code reorganization with possibly subtle side
> effects. So, I think it'd be better to produce a patch which just fixes the
> bug even if that ends up introducing another function in the flow.
Perhaps we can fix this bug at sched_post_fork(), which is executed between cgroup_can_fork()
and cgroup_post_fork(). Relocate the fectching of task_group and access it at sched_post_fork().
thanks.
>
> Thanks.
>
Powered by blists - more mailing lists