sched/core: Avoid multiple calling update_rq_clock() in __cfsb_csd_unthrottle()
authorHao Jia <jiahao.os@bytedance.com>
Tue, 13 Jun 2023 08:20:11 +0000 (16:20 +0800)
committerPeter Zijlstra <peterz@infradead.org>
Fri, 16 Jun 2023 20:08:13 +0000 (22:08 +0200)
commitebb83d84e49b54369b0db67136a5fe1087124dcc
treeb0db940a0de97b2759308c5bbb715a08f0d6513e
parent96500560f0c73c71bca1b27536c6254fa0e8ce37
sched/core: Avoid multiple calling update_rq_clock() in __cfsb_csd_unthrottle()

After commit 8ad075c2eb1f ("sched: Async unthrottling for cfs
bandwidth"), we may update the rq clock multiple times in the loop of
__cfsb_csd_unthrottle().

A prior (although less common) instance of this problem exists in
unthrottle_offline_cfs_rqs().

Cure both by ensuring update_rq_clock() is called before the loop and
setting RQCF_ACT_SKIP during the loop, to supress further updates.
The alternative would be pulling update_rq_clock() out of
unthrottle_cfs_rq(), but that gives an even bigger mess.

Fixes: 8ad075c2eb1f ("sched: Async unthrottling for cfs bandwidth")
Reviewed-By: Ben Segall <bsegall@google.com>
Suggested-by: Vincent Guittot <vincent.guittot@linaro.org>
Signed-off-by: Hao Jia <jiahao.os@bytedance.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Vincent Guittot <vincent.guittot@linaro.org>
Link: https://lkml.kernel.org/r/20230613082012.49615-4-jiahao.os@bytedance.com
kernel/sched/fair.c
kernel/sched/sched.h