The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Hang Zhengyang <hang.zhengyang1010@gmail.com>
Cc: David Vernet <void@manifault.com>,
	Andrea Righi <arighi@nvidia.com>,
	Changwoo Min <changwoo@igalia.com>,
	Ingo Molnar <mingo@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Juri Lelli <juri.lelli@redhat.com>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	Dietmar Eggemann <dietmar.eggemann@arm.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Ben Segall <bsegall@google.com>, Mel Gorman <mgorman@suse.de>,
	Valentin Schneider <vschneid@redhat.com>,
	K Prateek Nayak <kprateek.nayak@amd.com>,
	Cheng-Yang Chou <yphbchou0911@gmail.com>,
	Barret Rhoden <brho@google.com>, Josh Don <joshdon@google.com>,
	Hao Luo <haoluo@google.com>,
	sched-ext@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH sched_ext/for-7.4-fixes 0/2] sched_ext: Fix two races between fork and scx_post_fork()
Date: Fri, 04 Dec 2026 06:41:07 -1000	[thread overview]
Message-ID: <96906389c03ade50969027c149e5ca32@kernel.org> (raw)
In-Reply-To: <20261204012744.195571-1-hang.zhengyang1010@gmail.com>

Hello, Hang.

On Fri, Dec 04, 2026 at 01:27:42AM +0000, Hang Zhengyang wrote:
> Before scx_post_fork() runs, a new task can be reached by
> sched_setscheduler() (patch 1, since v6.12) and by a cgroup migration to
> another sub-scheduler (patch 2). Either can make ops.enable() run twice
> or trip the task state check.

Thanks for the fixes. Both changes look correct to me. A few style and
documentation points:

- The new comments mostly describe what the code does and not why. Can you
  update them to explain why? The one in switching_to_scx() is also
  difficult to follow.

- 1/2: Can switched_from_scx() read the task state once and test that?

- 2/2: scx_rehome_task() tests for the same condition as 1/2 but in a
  different style. Can you make it test the same way?

Thanks.

--
tejun

      parent reply	other threads:[~2026-12-04 16:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-04  1:27 [PATCH sched_ext/for-7.4-fixes 0/2] sched_ext: Fix two races between fork and scx_post_fork() Hang Zhengyang
2026-12-04  1:27 ` [PATCH sched_ext/for-7.4-fixes 1/2] sched_ext: Don't enable or disable a task being forked on class changes Hang Zhengyang
2026-12-04  1:27 ` [PATCH sched_ext/for-7.4-fixes 2/2] sched_ext: Don't enable a task twice when it migrates during fork Hang Zhengyang
2026-12-04 16:41 ` Tejun Heo [this message]

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=96906389c03ade50969027c149e5ca32@kernel.org \
    --to=tj@kernel.org \
    --cc=arighi@nvidia.com \
    --cc=brho@google.com \
    --cc=bsegall@google.com \
    --cc=changwoo@igalia.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=hang.zhengyang1010@gmail.com \
    --cc=haoluo@google.com \
    --cc=joshdon@google.com \
    --cc=juri.lelli@redhat.com \
    --cc=kprateek.nayak@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=sched-ext@lists.linux.dev \
    --cc=vincent.guittot@linaro.org \
    --cc=void@manifault.com \
    --cc=vschneid@redhat.com \
    --cc=yphbchou0911@gmail.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