Linux Documentation
 help / color / mirror / Atom feed
* [PATCH 0/2] sched/fair: Reset incompatible burst on quota change
@ 2026-08-20  3:32 Zhe Liu
  2026-08-20  3:32 ` [PATCH 1/2] " Zhe Liu
  2026-08-20  3:32 ` [PATCH 2/2] Documentation: describe burst reset on quota changes Zhe Liu
  0 siblings, 2 replies; 4+ messages in thread
From: Zhe Liu @ 2026-08-20  3:32 UTC (permalink / raw)
  To: tj, hannes, mkoutny, corbet, mingo, peterz, juri.lelli,
	vincent.guittot
  Cc: skhan, dietmar.eggemann, rostedt, bsegall, mgorman, vschneid,
	kprateek.nayak, cgroups, linux-doc, linux-kselftest, linux-kernel,
	Zhe Liu

A burst configured while a cgroup has unlimited CPU bandwidth can prevent
a later finite quota from being installed.  On cgroup v2, for instance:

  # echo 100000000 > cpu.max.burst
  # echo "50000 100000" > cpu.max
  sh: write error: Invalid argument

The quota stays unlimited because tg_set_bandwidth() validates the existing
burst against the new quota, and the only recovery is for userspace to know
that it must clear the burst before retrying the quota update.  cgroup v1 has
the same problem through cpu.cfs_quota_us.

Patch 1 resets the existing burst to zero when a valid finite quota is written
that the burst is incompatible with, while preserving it when it remains
compatible or when the new quota is unlimited.  This lets a quota update take
effect regardless of the order in which userspace writes the two files, and
still allows a burst to be staged before bandwidth control is enabled.  A
cgroup v2 selftest is added for the behavior.

Patch 2 documents the reset behavior in the cgroup v1 and v2 CPU bandwidth
documentation.

Zhe Liu (2):
  sched/fair: Reset incompatible burst on quota change
  Documentation: describe burst reset on quota changes

 Documentation/admin-guide/cgroup-v2.rst   |  5 +-
 Documentation/scheduler/sched-bwc.rst     | 14 ++---
 kernel/sched/core.c                       | 17 ++++++-
 tools/testing/selftests/cgroup/test_cpu.c | 62 +++++++++++++++++++++++
 4 files changed, 90 insertions(+), 8 deletions(-)

-- 
2.25.1


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

end of thread, other threads:[~2026-08-20 11:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-20  3:32 [PATCH 0/2] sched/fair: Reset incompatible burst on quota change Zhe Liu
2026-08-20  3:32 ` [PATCH 1/2] " Zhe Liu
2026-08-20 11:43   ` Michal Koutný
2026-08-20  3:32 ` [PATCH 2/2] Documentation: describe burst reset on quota changes Zhe Liu

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