]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
sched/fair: Convert cfs bandwidth throttling to use guards
authorK Prateek Nayak <kprateek.nayak@amd.com>
Tue, 2 Jun 2026 05:00:01 +0000 (05:00 +0000)
committerPeter Zijlstra <peterz@infradead.org>
Tue, 2 Jun 2026 10:26:11 +0000 (12:26 +0200)
commit1abbecd1d2d2fdd96e52f541f07ee2b163631bee
treeb7503f863a5751d08cc555cbc243f19a266d9b84
parentb8fea7af0e40feb6d9cbbd60b66ff0ec265e868f
sched/fair: Convert cfs bandwidth throttling to use guards

Routine conversion of rcu_read_lock(), spin_lock*, and rq_lock usage
within the cfs bandwidth controller to use class guards.

Only notable changes are:

 - Checking for "cfs_rq->runtime_remaining <= 0" instead of the inverse
   to spot a throttle and break early. This also saves the need
   for extra indentation in the unthrottle case.

 - Reordering of list_del_rcu() against throttled_clock indicator update
   in unthrottle_cfs_rq(). Both are done with "cfs_b->lock" held after
   the "cfs_rq->throttled" is cleared which make the reordering safe
   against concurrent list modifications.

No functional changes intended.

Signed-off-by: K Prateek Nayak <kprateek.nayak@amd.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Ben Segall <bsegall@google.com>
Tested-by: Aaron Lu <ziqianlu@bytedance.com>
Link: https://patch.msgid.link/20260602050005.11160-2-kprateek.nayak@amd.com
kernel/sched/fair.c