From: Andrea Righi <arighi@nvidia.com>
To: Tejun Heo <tj@kernel.org>
Cc: Cheng-Yang Chou <yphbchou0911@gmail.com>,
sched-ext@lists.linux.dev, David Vernet <void@manifault.com>,
Changwoo Min <changwoo@igalia.com>,
Ching-Chun Huang <jserv@ccns.ncku.edu.tw>,
Chia-Ping Tsai <chia7712@gmail.com>,
kernel test robot <lkp@intel.com>,
Emil Tsalapatis <emil@etsalapatis.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] sched_ext: Fix build errors and unused label warning in non-cgroup configs
Date: Sun, 22 Mar 2026 00:26:49 +0100 [thread overview]
Message-ID: <ab8pOX7ef-dN9pjJ@gpd4> (raw)
In-Reply-To: <49aeada41a0e78e9673f053806321df3@kernel.org>
Hi,
On Sat, Mar 21, 2026 at 09:10:03AM -1000, Tejun Heo wrote:
> Hello,
>
> On Sat, Mar 21, 2026 at 03:35:20PM +0100, Andrea Righi wrote:
> > This looks like a false positive, the kernel test robot likely tested
> > with a manually crafted config, so I think we shouldn't apply this
> > patch.
>
> It's not a false positive. CONFIG_SCHED_CLASS_EXT doesn't depend on
> CONFIG_CGROUPS in Kconfig, so SCHED_CLASS_EXT=y with CGROUPS=n is a
> valid config. I reproduced the build failure using the bot's config.
>
> The issue is that CONFIG_EXT_SUB_SCHED is def_bool y depending only on
> SCHED_CLASS_EXT, so it's always on. But EXT_SUB_SCHED fundamentally
> needs cgroups (cgroup_path, cgroup_get, cgroup_put, cgroup_id, etc.),
> so the missing dependency is there.
Ah you guys are right! I was assuming that you can't have
CONFIG_SCHED_CLASS_EXT=y and CONFIG_CGROUPS=n, but that's just wrong.
So ignore my comment and sorry for the noise.
>
> Cheng-Yang, can you send a v2 with the following approach?
>
> 1. Add CGROUPS dependency to EXT_SUB_SCHED in init/Kconfig:
>
> config EXT_SUB_SCHED
> def_bool y
> - depends on SCHED_CLASS_EXT
> + depends on SCHED_CLASS_EXT && CGROUPS
>
> 2. Guard err_stop_helper with #ifdef CONFIG_EXT_SUB_SCHED (only
> jumped to from within CONFIG_EXT_SUB_SCHED code):
>
> +#ifdef CONFIG_EXT_SUB_SCHED
> err_stop_helper:
> kthread_destroy_worker(sch->helper);
> +#endif
> err_free_pcpu:
>
> 3. Guard cgroup_get/cgroup_put in common paths with the existing
> CONFIG_EXT_GROUP_SCHED || CONFIG_EXT_SUB_SCHED pattern (matching
> the root_cgroup() / sch_cgroup() stubs):
>
> err_put_cgrp:
> +#if defined(CONFIG_EXT_GROUP_SCHED) || defined(CONFIG_EXT_SUB_SCHED)
> cgroup_put(cgrp);
> +#endif
>
> and:
>
> +#if defined(CONFIG_EXT_GROUP_SCHED) || defined(CONFIG_EXT_SUB_SCHED)
> cgroup_get(cgrp);
> +#endif
> sch = scx_alloc_and_add_sched(ops, cgrp, NULL);
>
> I verified this builds clean with both CGROUPS=y and CGROUPS=n.
And this looks good also on my side.
Thanks,
-Andrea
next prev parent reply other threads:[~2026-03-21 23:26 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20260321070605.691776-1-yphbchou0911@gmail.com>
[not found] ` <ab6sqIW4p8QKYQXA@gpd4>
2026-03-21 19:10 ` [PATCH] sched_ext: Fix build errors and unused label warning in non-cgroup configs Tejun Heo
2026-03-21 23:26 ` Andrea Righi [this message]
2026-03-22 6:43 ` Cheng-Yang Chou
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=ab8pOX7ef-dN9pjJ@gpd4 \
--to=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=lkp@intel.com \
--cc=sched-ext@lists.linux.dev \
--cc=tj@kernel.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox