linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Zhang Qiao <zhangqiao22@huawei.com>
Cc: mingo@redhat.com, peterz@infradead.org,
	linux-kernel@vger.kernel.org, juri.lelli@redhat.com,
	vincent.guittot@linaro.org, dietmar.eggemann@arm.com,
	rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de,
	bristot@redhat.com
Subject: Re: [PATCH v2] kernel/sched: Fix sched_fork() access an invalid sched_task_group
Date: Mon, 13 Sep 2021 08:01:00 -1000	[thread overview]
Message-ID: <YT+R3EnFgs78Vyvh@slm.duckdns.org> (raw)
In-Reply-To: <20210911075054.6358-1-zhangqiao22@huawei.com>

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
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.

Thanks.

-- 
tejun

  reply	other threads:[~2021-09-13 18:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-11  7:50 [PATCH v2] kernel/sched: Fix sched_fork() access an invalid sched_task_group Zhang Qiao
2021-09-13 18:01 ` Tejun Heo [this message]
2021-09-14  8:20   ` Zhang Qiao
2021-09-14 16:23     ` Tejun Heo
2021-09-15  3:10       ` Zhang Qiao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YT+R3EnFgs78Vyvh@slm.duckdns.org \
    --to=tj@kernel.org \
    --cc=bristot@redhat.com \
    --cc=bsegall@google.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=vincent.guittot@linaro.org \
    --cc=zhangqiao22@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).