From: Tejun Heo <tj@kernel.org>
To: Cheng-Yang Chou <yphbchou0911@gmail.com>,
sched-ext@lists.linux.dev, David Vernet <void@manifault.com>,
Andrea Righi <arighi@nvidia.com>,
Changwoo Min <changwoo@igalia.com>
Cc: Ching-Chun Huang <jserv@ccns.ncku.edu.tw>,
Chia-Ping Tsai <chia7712@gmail.com>,
Emil Tsalapatis <emil@etsalapatis.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH sched_ext/for-7.0-fixes] sched_ext: Fix invalid kobj cast in scx_uevent()
Date: Sun, 22 Mar 2026 09:55:11 -1000 [thread overview]
Message-ID: <c012fdc44ce9c0ea7c2b3bf291338f10@kernel.org> (raw)
In-Reply-To: <20260322171309.2640439-1-yphbchou0911@gmail.com>
Hello,
The fix itself looks correct but could you please update a few things for v2?
- The patch description says that kset_register() of the sched_ext kset
itself triggers this during init. That's not actually the case -
kset_create_and_add() sets kobj.kset = NULL on the kset's own kobject,
so kobject_uevent_env() can't find a kset and the uevent is silently
dropped.
The actual trigger is the sub-scheduler kset created at
scx_alloc_and_add_sched() -> kset_create_and_add("sub", NULL,
&sch->kobj). That sub-kset's kobject has sch->kobj as its parent, and
sch->kobj.kset = scx_kset, so the uevent walk finds scx_kset and calls
scx_uevent() with the sub-kset's kobject which isn't a struct scx_sched.
Please update the description to reflect this.
- Move the variable declaration to the top of the function. There's no
functional difference but the current placement looks messy - just put
the ktype check between the declaration and the use.
- Add a comment explaining why the check is needed - that scx_uevent()
can be reached by both scx_sched kobjects (scx_ktype) and sub-scheduler
kset kobjects (kset_ktype) through the parent chain walk, and we need to
filter out the latter.
Thanks.
--
tejun
prev parent reply other threads:[~2026-03-22 19:55 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-22 17:13 [PATCH sched_ext/for-7.0-fixes] sched_ext: Fix invalid kobj cast in scx_uevent() Cheng-Yang Chou
2026-03-22 19:55 ` 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=c012fdc44ce9c0ea7c2b3bf291338f10@kernel.org \
--to=tj@kernel.org \
--cc=arighi@nvidia.com \
--cc=changwoo@igalia.com \
--cc=chia7712@gmail.com \
--cc=emil@etsalapatis.com \
--cc=jserv@ccns.ncku.edu.tw \
--cc=linux-kernel@vger.kernel.org \
--cc=sched-ext@lists.linux.dev \
--cc=void@manifault.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.