From: Andrea Righi <arighi@nvidia.com>
To: Cheng-Yang Chou <yphbchou0911@gmail.com>
Cc: sched-ext@lists.linux.dev, Tejun Heo <tj@kernel.org>,
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>
Subject: Re: [PATCH] sched_ext: Fix build errors and unused label warning in non-cgroup configs
Date: Sat, 21 Mar 2026 15:35:20 +0100 [thread overview]
Message-ID: <ab6sqIW4p8QKYQXA@gpd4> (raw)
In-Reply-To: <20260321070605.691776-1-yphbchou0911@gmail.com>
Hi Cheng-Yang,
On Sat, Mar 21, 2026 at 03:05:15PM +0800, Cheng-Yang Chou wrote:
> When building without CONFIG_EXT_GROUP_SCHED and CONFIG_EXT_SUB_SCHED,
> clang reports errors for undeclared cgroup_put() and cgroup_get() calls.
> It also flags an unused err_stop_helper label.
>
> This conditionally compiles the cgroup reference counting functions and
> the error handling label to match the configurations that require them,
> preventing implicit declaration errors and unused label warnings.
>
> Tested with both configs enabled/disabled.
>
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202603210903.IrKhPd6k-lkp@intel.com/
> Signed-off-by: Cheng-Yang Chou <yphbchou0911@gmail.com>
> ---
> kernel/sched/ext.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/kernel/sched/ext.c b/kernel/sched/ext.c
> index 94548ee9ad85..2e7a1259bd7c 100644
> --- a/kernel/sched/ext.c
> +++ b/kernel/sched/ext.c
> @@ -6494,8 +6494,10 @@ static struct scx_sched *scx_alloc_and_add_sched(struct sched_ext_ops *ops,
> #endif /* CONFIG_EXT_SUB_SCHED */
> return sch;
>
> +#ifdef CONFIG_EXT_SUB_SCHED
> err_stop_helper:
> kthread_destroy_worker(sch->helper);
> +#endif
CONFIG_EXT_SUB_SCHED is always defined whenever ext.c compiles, so this one
is unnecessary.
> err_free_pcpu:
> for_each_possible_cpu(cpu) {
> if (cpu == bypass_fail_cpu)
> @@ -6514,7 +6516,9 @@ static struct scx_sched *scx_alloc_and_add_sched(struct sched_ext_ops *ops,
> err_free_sch:
> kfree(sch);
> err_put_cgrp:
> +#if defined(CONFIG_EXT_GROUP_SCHED) || defined(CONFIG_EXT_SUB_SCHED)
> cgroup_put(cgrp);
> +#endif
This ifdef around cgroup_get()/cgroup_put() also always evaluates to true
because EXT_SUB_SCHED is always true regardless of EXT_GROUP_SCHED.
> return ERR_PTR(ret);
> }
>
> @@ -6603,7 +6607,9 @@ static void scx_root_enable_workfn(struct kthread_work *work)
> if (ret)
> goto err_unlock;
>
> +#if defined(CONFIG_EXT_GROUP_SCHED) || defined(CONFIG_EXT_SUB_SCHED)
> cgroup_get(cgrp);
> +#endif
Ditto.
> sch = scx_alloc_and_add_sched(ops, cgrp, NULL);
> if (IS_ERR(sch)) {
> ret = PTR_ERR(sch);
> --
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.
Thanks,
-Andrea
next prev parent reply other threads:[~2026-03-21 14:35 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-21 7:05 [PATCH] sched_ext: Fix build errors and unused label warning in non-cgroup configs Cheng-Yang Chou
2026-03-21 14:35 ` Andrea Righi [this message]
2026-03-21 17:31 ` Cheng-Yang Chou
2026-03-21 19:10 ` Tejun Heo
2026-03-21 23:26 ` Andrea Righi
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=ab6sqIW4p8QKYQXA@gpd4 \
--to=arighi@nvidia.com \
--cc=changwoo@igalia.com \
--cc=chia7712@gmail.com \
--cc=jserv@ccns.ncku.edu.tw \
--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 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.