]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
sched/core: Reorganize cgroup bandwidth control interface file writes
authorTejun Heo <tj@kernel.org>
Sat, 14 Jun 2025 01:23:30 +0000 (15:23 -1000)
committerPeter Zijlstra <peterz@infradead.org>
Wed, 18 Jun 2025 11:59:57 +0000 (13:59 +0200)
commit5bc34be478d09c4d16009e665e020ad0fcd0deea
tree36ddf77144edc576ce3259e85c10b825b783b8a6
parent43e33f53e25687ca870248d1939cfade0164426c
sched/core: Reorganize cgroup bandwidth control interface file writes

- Move input parameter validation from tg_set_cfs_bandwidth() to the new
  outer function tg_set_bandwidth(). The outer function handles parameters
  in usecs, validates them and calls tg_set_cfs_bandwidth() which converts
  them into nsecs. This matches tg_bandwidth() on the read side.

- max/min_cfs_* consts are now used by tg_set_bandwidth(). Relocate, convert
  into usecs and drop "cfs" from the names.

- Reimplement cpu_cfs_{period|quote|burst}_write_*() using tg_bandwidth()
  and tg_set_bandwidth() and replace "cfs" in the names with "bw".

- Update cpu_max_write() to use tg_set_bandiwdth(). cpu_period_quota_parse()
  is updated to drop nsec conversion accordingly. This aligns the behavior
  with cfs_period_quota_print().

- Drop now unused tg_set_cfs_{period|quota|burst}().

- While at it, for consistency, rename default_cfs_period() to
  default_bw_period_us() and make it return usecs.

This is to prepare for adding bandwidth control support to sched_ext.
tg_set_bandwidth() will be used as the muxing point. No functional changes
intended.

Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lore.kernel.org/r/20250614012346.2358261-5-tj@kernel.org
kernel/sched/core.c
kernel/sched/fair.c
kernel/sched/sched.h