sched/fair: Refill bandwidth before scaling
authorHuaixin Chang <changhuaixin@linux.alibaba.com>
Mon, 20 Apr 2020 02:44:21 +0000 (10:44 +0800)
committerPeter Zijlstra <peterz@infradead.org>
Thu, 30 Apr 2020 18:14:40 +0000 (20:14 +0200)
commit5a6d6a6ccb5f48ca8cf7c6d64ff83fd9c7999390
tree1f9d369362c55ed780292d621b35251f2db0cf0d
parent457d1f465778ccb5f14f7d7a62245e41d12a3804
sched/fair: Refill bandwidth before scaling

In order to prevent possible hardlockup of sched_cfs_period_timer()
loop, loop count is introduced to denote whether to scale quota and
period or not. However, scale is done between forwarding period timer
and refilling cfs bandwidth runtime, which means that period timer is
forwarded with old "period" while runtime is refilled with scaled
"quota".

Move do_sched_cfs_period_timer() before scaling to solve this.

Fixes: 2e8e19226398 ("sched/fair: Limit sched_cfs_period_timer() loop to avoid hard lockup")
Signed-off-by: Huaixin Chang <changhuaixin@linux.alibaba.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Ben Segall <bsegall@google.com>
Reviewed-by: Phil Auld <pauld@redhat.com>
Link: https://lkml.kernel.org/r/20200420024421.22442-3-changhuaixin@linux.alibaba.com
kernel/sched/fair.c