Commit e030b710 authored by Huaixin Chang's avatar Huaixin Chang Committed by Xia Fukun
Browse files

sched/fair: Refill bandwidth before scaling

mainline inclusion
from mainline-v6.5-rc7
commit 5a6d6a6c
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I8EUCE


CVE: NA

--------------------------------

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: 2e8e1922 ("sched/fair: Limit sched_cfs_period_timer() loop to avoid hard lockup")
Signed-off-by: default avatarHuaixin Chang <changhuaixin@linux.alibaba.com>
Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: default avatarBen Segall <bsegall@google.com>
Reviewed-by: default avatarPhil Auld <pauld@redhat.com>
Link: https://lkml.kernel.org/r/20200420024421.22442-3-changhuaixin@linux.alibaba.com


Signed-off-by: default avatarXia Fukun <xiafukun@huawei.com>
parent 6cea0048
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment