public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH sched_ext/for-7.0-fixes] sched_ext: Fix invalid kobj cast in scx_uevent()
       [not found] <20260322171309.2640439-1-yphbchou0911@gmail.com>
@ 2026-03-22 19:55 ` Tejun Heo
  0 siblings, 0 replies; only message in thread
From: Tejun Heo @ 2026-03-22 19:55 UTC (permalink / raw)
  To: Cheng-Yang Chou, sched-ext, David Vernet, Andrea Righi,
	Changwoo Min
  Cc: Ching-Chun Huang, Chia-Ping Tsai, Emil Tsalapatis, linux-kernel

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-03-22 19:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20260322171309.2640439-1-yphbchou0911@gmail.com>
2026-03-22 19:55 ` [PATCH sched_ext/for-7.0-fixes] sched_ext: Fix invalid kobj cast in scx_uevent() Tejun Heo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox