From: sashiko-bot@kernel.org
To: "Tao Cui" <cui.tao@linux.dev>
Cc: sched-ext@lists.linux.dev, bpf@vger.kernel.org
Subject: Re: [PATCH RFC] sched_ext: warn when cpu.max is set but the BPF scheduler doesn't implement bandwidth control
Date: Tue, 18 Aug 2026 14:10:51 +0000 [thread overview]
Message-ID: <20260818141052.443E81F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260818135328.174152-1-cui.tao@linux.dev>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The new warning for unenforced `cpu.max` is missing during BPF scheduler initialization, meaning preexisting cgroup quotas are silently ignored without notification.
--
--- Patch [1]: [PATCH RFC] sched_ext: warn when cpu.max is set but the BPF scheduler doesn't implement bandwidth control ---
commit 88bd45e8c02c048f00992a1d03614c8ef709c738
Author: Tao Cui <cuitao@kylinos.cn>
sched_ext: warn when cpu.max is set but the BPF scheduler doesn't implement bandwidth control
This commit adds a one-time warning when a finite cpu.max quota is
configured on a cgroup but the active BPF scheduler lacks the
cgroup_set_bandwidth callback. The intent is to notify users and
orchestrators that the quota is silently ignored and not enforced by the
scheduler.
> diff --git a/kernel/sched/ext/ext.c b/kernel/sched/ext/ext.c
> index 18183062f751c..1067d271f6b27 100644
> --- a/kernel/sched/ext/ext.c
> +++ b/kernel/sched/ext/ext.c
> @@ -4565,6 +4565,12 @@ void scx_group_set_bandwidth(struct task_group *tg,
> tg->scx.bw_burst_us != burst_us))
> SCX_CALL_OP(sch, cgroup_set_bandwidth, NULL,
> tg_cgrp(tg), period_us, quota_us, burst_us);
> + else if (scx_cgroup_enabled && sch &&
> + !SCX_HAS_OP(sch, cgroup_set_bandwidth) &&
> + quota_us != RUNTIME_INF)
> + pr_warn_once("sched_ext: BPF scheduler \"%s\" does not implement "
> + "ops.cgroup_set_bandwidth(); cpu.max will not be enforced\n",
> + sch->ops.name);
[Severity: Medium]
Will this warning also catch preexisting cgroup bandwidth configurations?
If a user configures a finite cpu.max limit on a cgroup before the BPF
scheduler is loaded, the initialization path in scx_cgroup_init() passes
the existing quota to the scheduler:
kernel/sched/ext/ext.c:scx_cgroup_init() {
...
struct scx_cgroup_init_args args = {
.weight = tg->scx.weight,
.bw_period_us = tg->scx.bw_period_us,
.bw_quota_us = tg->scx.bw_quota_us,
.bw_burst_us = tg->scx.bw_burst_us,
};
...
ret = SCX_CALL_OP_RET(sch, cgroup_init, NULL,
css->cgroup, &args);
...
}
Should scx_cgroup_init() also check for an unenforced quota and emit this
warning, to ensure users are notified when preexisting configurations are
silently ignored?
>
> tg->scx.bw_period_us = period_us;
> tg->scx.bw_quota_us = quota_us;
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260818135328.174152-1-cui.tao@linux.dev?part=1
next prev parent reply other threads:[~2026-08-18 14:10 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-18 13:53 [PATCH RFC] sched_ext: warn when cpu.max is set but the BPF scheduler doesn't implement bandwidth control Tao Cui
2026-08-18 13:58 ` Tao Cui
2026-08-18 14:10 ` sashiko-bot [this message]
2026-08-18 15:34 ` Tejun Heo
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=20260818141052.443E81F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=cui.tao@linux.dev \
--cc=sashiko-reviews@lists.linux.dev \
--cc=sched-ext@lists.linux.dev \
/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