[PATCH v2 0/2] minor cpu bandwidth control fix

From: Chuyi Zhou
Date: Tue Jul 23 2024 - 08:20:24 EST


Hello,

This patchset tries to fix the minor issues in cpu bandwidthe control.

patch#1 tries to fix the inaccurate __cfs_bandwidth_used.
patch#2 tries to reduce the unnecessary overhead in
tg_set_cfs_bandwidth() observed in our production environment.

Please see individual patches for more details, and comments are always
welcome.

---
Changes in v2:
patch#1:
- guard(cpus_read_lock) before cfs_bandwidth_usage_dec() in
destroy_cfs_bandwidth().(Benjamin)
- do cfs_bandwidth_usage_dec after __cfsb_csd_unthrottle loop.(Benjamin)
- move the call to destroy_cfs_bandwidth() to cpu_cgroup_css_free
(Benjamin)
patch#2:
- move the check under cfs_constraints_mutex.(Chengming and Benjamin)
Link to v1:https://lore.kernel.org/lkml/20240721125208.5348-1-zhouchuyi@xxxxxxxxxxxxx/

Chuyi Zhou (2):
sched/fair: Decrease cfs bandwidth usage in task_group destruction
sched/core: Avoid unnecessary update in tg_set_cfs_bandwidth

kernel/sched/core.c | 5 +++++
kernel/sched/fair.c | 13 +++++++------
kernel/sched/sched.h | 2 ++
3 files changed, 14 insertions(+), 6 deletions(-)

--
2.20.1