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 increasing quota and
burst in the burst-first order can fail with EINVAL.

This series keeps the configured burst value independent of the current quota
and applies the quota-relative clamp when CFS refills runtime. It also adds a
selftest for both write orders and documents the resulting behavior for cgroup
v1 and cgroup v2.

Changes in v2:
  - apply the clamp at refill time instead of changing the configured burst;
  - retain the value reported by cpu.max.burst and cpu.cfs_burst_us;
  - add write-order selftests and update the CPU bandwidth documentation.

Testing:
  make -C tools/testing/selftests TARGETS=cgroup

Zhe Liu (3):
  sched/fair: Remove the write-order dependency between cpu.max and
    cpu.max.burst
  selftests: cgroup: Test CPU quota and burst write order
  Documentation: describe CPU quota and burst ordering

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

-- 
2.25.1

Reply via email to