All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fernand Sieber <sieberf@amazon.com>
To: Ingo Molnar <mingo@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Juri Lelli <juri.lelli@redhat.com>,
	Vincent Guittot <vincent.guittot@linaro.org>
Cc: Tejun Heo <tj@kernel.org>, David Vernet <void@manifault.com>,
	Andrea Righi <arighi@nvidia.com>,
	Changwoo Min <changwoo@igalia.com>,
	Dietmar Eggemann <dietmar.eggemann@arm.com>,
	Ben Segall <bsegall@google.com>, Mel Gorman <mgorman@suse.de>,
	<linux-kernel@vger.kernel.org>, <nh-open-source@amazon.com>,
	Fahad Mubeen <fmubeen@amazon.de>,
	"Hendrik Borghorst" <hborghor@amazon.de>,
	David Woodhouse <dwmw@amazon.co.uk>,
	Fernand Sieber <sieberf@amazon.com>
Subject: [PATCH 0/2] sched/fair: expose cpu.max.runtime for credit injection
Date: Mon, 25 May 2026 21:36:20 +0200	[thread overview]
Message-ID: <20260525193622.70282-1-sieberf@amazon.com> (raw)

This series adds a cpu.max.runtime cgroup v2 interface that allows
userspace to set the CFS bandwidth controller's runtime directly,
enabling CPU credit injection.

An orchestrator writes a runtime budget which the cgroup consumes
naturally through the existing bandwidth enforcement mechanism. Each
period, the task consumes runtime and the refill restores only quota
(capped at quota + burst), so the injected credits drain until runtime
falls below the cap, after which the cgroup returns to its steady-state
quota allocation.

The series also relaxes the burst validation: burst is no longer
required to be <= quota, only that burst + quota does not overflow.
This allows configuring burst > quota so that the runtime cap can reach
up to one full period, enabling 100% utilization while credits last.

A selftest (test_cpucg_max_runtime) validates the credit injection
mechanism by configuring a cgroup with minimal quota but large burst,
injecting credits via cpu.max.runtime, and verifying that the resulting
CPU usage matches the injected budget.

Patch 1 adds the core interface and selftest.
Patch 2 adds sched_ext integration: an ops callback for BPF scheduler
notification when runtime credits are injected.

Fernand Sieber (2):
  sched/fair: expose cpu.max.runtime to set bandwidth runtime directly
  sched/ext: add cgroup_set_runtime ops callback

 include/linux/sched/ext.h                 |  1 +
 kernel/sched/core.c                       | 46 ++++++++++++++++-
 kernel/sched/ext.c                        | 17 +++++++
 kernel/sched/ext.h                        |  2 +
 kernel/sched/ext_internal.h               | 12 +++++
 tools/testing/selftests/cgroup/test_cpu.c | 62 +++++++++++++++++++++++
 6 files changed, 138 insertions(+), 2 deletions(-)

-- 
2.47.3




Amazon Development Centre (South Africa) (Proprietary) Limited
29 Gogosoa Street, Observatory, Cape Town, Western Cape, 7925, South Africa
Registration Number: 2004 / 034463 / 07


             reply	other threads:[~2026-05-25 19:36 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-25 19:36 Fernand Sieber [this message]
2026-05-25 19:36 ` [PATCH 1/2] sched/fair: expose cpu.max.runtime to set bandwidth runtime directly Fernand Sieber
2026-05-26 20:52   ` Benjamin Segall
2026-05-28  7:25     ` Fernand Sieber
2026-05-27 19:04   ` Tejun Heo
2026-05-28  6:54     ` Fernand Sieber
2026-05-28 14:37       ` Tejun Heo
2026-05-25 19:36 ` [PATCH 2/2] sched/ext: add cgroup_set_runtime ops callback Fernand Sieber

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=20260525193622.70282-1-sieberf@amazon.com \
    --to=sieberf@amazon.com \
    --cc=arighi@nvidia.com \
    --cc=bsegall@google.com \
    --cc=changwoo@igalia.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=dwmw@amazon.co.uk \
    --cc=fmubeen@amazon.de \
    --cc=hborghor@amazon.de \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=nh-open-source@amazon.com \
    --cc=peterz@infradead.org \
    --cc=tj@kernel.org \
    --cc=vincent.guittot@linaro.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 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.