mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tao Cui <cui.tao@linux.dev>
To: Tejun Heo <tj@kernel.org>
Cc: cui.tao@linux.dev, void@manifault.com, arighi@nvidia.com,
	changwoo@igalia.com, suzhidao@xiaomi.com,
	sched-ext@lists.linux.dev, linux-kernel@vger.kernel.org,
	bpf@vger.kernel.org, Tao Cui <cuitao@kylinos.cn>
Subject: Re: [PATCH RFC] sched_ext: warn when cpu.max is set but the BPF scheduler doesn't implement bandwidth control
Date: Wed, 19 Aug 2026 08:57:03 +0800	[thread overview]
Message-ID: <593de517-8835-42ce-9d1a-0362f9066e95@linux.dev> (raw)
In-Reply-To: <aoR7ngyE44epfzXO@slm.duckdns.org>


Hello,
在 2026/8/18 23:34, Tejun Heo 写道:
> Hello,
> 
> On Tue, Aug 18, 2026 at 09:53:28PM +0800, Tao Cui wrote:
>> From: Tao Cui <cuitao@kylinos.cn>
>>
>> The kernel stores cpu.max bandwidth parameters in the task_group and
>> passes them to the BPF scheduler via ops.cgroup_set_bandwidth() and
>> scx_cgroup_init_args, but does not enforce the quota itself. If the
>> loaded BPF scheduler doesn't implement the callback, cpu.max is
>> silently ignored -- the cgroup gets unlimited CPU regardless of the
>> configured quota.
>>
>> Of the example schedulers, only scx_qmap implements the callback --
>> and only to bpf_printk() the parameters, so no in-tree scheduler
>> actually enforces the quota. Measured with scx_simple: a
>> cgroup with cpu.max = "50000 100000" (50% of one CPU) and one
>> busy task used 9946ms of CPU in 10 seconds with nr_throttled
>> remaining 0.
>>
>> Print a one-time warning when a finite quota is configured on a
>> cgroup while the active scheduler lacks the callback, so users and
>> container orchestrators know the quota is not enforced.
> 
> We had something similar with cpu.weight and it created more annoaynces than
> helping anything. cgroup bw control isn't the only thing the BPF scheduler
> may skip to implement. It can also choose to ignore e.g. nice levels
> completely too and there's no way to detect things like that. Documentation
> is probably the right way to handle this.
> 

Understood, the cpu.weight precedent makes sense: the scheduler may
ignore a whole set of knobs, and warning on just one of them would be
arbitrary.

I'll follow up with a patch to sched-ext.rst instead: a note that
cgroup CPU knobs like cpu.max only take effect if the loaded scheduler
implements the corresponding callbacks, and that schedulers may also
ignore things like nice levels.

Thanks,
Tao

> Thanks.
> 


      reply	other threads:[~2026-08-19  0:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-18 13:53 Tao Cui
2026-08-18 13:58 ` Tao Cui
2026-08-18 15:34 ` Tejun Heo
2026-08-19  0:57   ` Tao Cui [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=593de517-8835-42ce-9d1a-0362f9066e95@linux.dev \
    --to=cui.tao@linux.dev \
    --cc=arighi@nvidia.com \
    --cc=bpf@vger.kernel.org \
    --cc=changwoo@igalia.com \
    --cc=cuitao@kylinos.cn \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sched-ext@lists.linux.dev \
    --cc=suzhidao@xiaomi.com \
    --cc=tj@kernel.org \
    --cc=void@manifault.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

all inboxes | Powered by JetHome®