Linux Documentation
 help / color / mirror / Atom feed
* [PATCH v3 0/3] sched/fair: remove quota/burst write-order dependency
@ 2026-09-11  9:22 Zhe Liu
  2026-09-11  9:22 ` [PATCH v3 1/3] " Zhe Liu
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Zhe Liu @ 2026-09-11  9:22 UTC (permalink / raw)
  To: tj, hannes, mkoutny, corbet, mingo, peterz, juri.lelli,
	vincent.guittot
  Cc: skhan, rdunlap, dietmar.eggemann, rostedt, bsegall, mgorman,
	vschneid, kprateek.nayak, dtcccc, changhuaixin, shanpeic, cgroups,
	linux-doc, linux-kernel, linux-kselftest, Zhe Liu

The CPU bandwidth quota and burst controls currently make the order of
userspace writes significant. A burst configured while quota is unlimited
can prevent a later finite quota from being installed, and updating the
burst before increasing the quota can fail with -EINVAL.

Remove the write-order dependency by decoupling burst validation from the
current quota. The previous quota-relative checks implicitly limited the
maximum configurable burst to max_bw_runtime_us / 2 for a finite quota,
so retain that limit as an independent upper bound.

Keep the configured burst unchanged across quota updates, and cap the
burst actually available at refill time to min(burst, quota). This allows
cpu.max and cpu.max.burst to be updated in either order without changing
the maximum burst previously allowed for a finite quota.

The series also adds a selftest covering both write orders and documents
the resulting behavior for cgroup v1 and cgroup v2.

---
Changes in v3:
- Use max_bw_runtime_us / 2 as an independent upper bound for burst,
  preserving the maximum burst previously allowed with a finite quota
  while removing its dependency on the current quota.
- Drop Cc: stable@vger.kernel.org from patch 1.
- Update the cpu.max.burst documentation to describe the configured burst
  independently of the current quota and the quota-relative clamp applied
  at runtime refill.

Changes in v2:
- Keep the configured burst independent of quota changes instead of
  adjusting or resetting it when the quota is updated.
- Move the quota-relative restriction to the CFS runtime refill path,
  where the effective burst is capped to the current quota.
- Add selftests covering quota and burst updates in both write orders and
  document the resulting behavior for cgroup v1 and cgroup v2.

v2: https://lore.kernel.org/all/20260904062013.504236-1-liuzhe1@kylinos.cn/
v1: https://lore.kernel.org/all/20260820033218.214259-1-liuzhe1@kylinos.cn/

Zhe Liu (3):
  sched/fair: remove quota/burst write-order dependency
  selftests: cgroup: test CPU quota and burst write order
  docs: cgroup-v2: document CPU quota and burst ordering

 Documentation/admin-guide/cgroup-v2.rst   |  7 +++-
 Documentation/scheduler/sched-bwc.rst     | 22 ++++++++-----
 kernel/sched/core.c                       |  3 +-
 kernel/sched/fair.c                       |  3 +-
 tools/testing/selftests/cgroup/test_cpu.c | 40 +++++++++++++++++++++++
 5 files changed, 62 insertions(+), 13 deletions(-)


base-commit: df2908090cda368b01ff43709f51890076c56157
-- 
2.25.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-09-11  9:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-11  9:22 [PATCH v3 0/3] sched/fair: remove quota/burst write-order dependency Zhe Liu
2026-09-11  9:22 ` [PATCH v3 1/3] " Zhe Liu
2026-09-11  9:22 ` [PATCH v3 2/3] selftests: cgroup: test CPU quota and burst write order Zhe Liu
2026-09-11  9:22 ` [PATCH v3 3/3] docs: cgroup-v2: document CPU quota and burst ordering Zhe Liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox