From: "tip-bot2 for Huaixin Chang" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Huaixin Chang <changhuaixin@linux.alibaba.com>,
"Peter Zijlstra (Intel)" <peterz@infradead.org>,
Ben Segall <bsegall@google.com>, Phil Auld <pauld@redhat.com>,
x86 <x86@kernel.org>, LKML <linux-kernel@vger.kernel.org>
Subject: [tip: sched/core] sched/fair: Refill bandwidth before scaling
Date: Fri, 01 May 2020 18:22:08 -0000 [thread overview]
Message-ID: <158835732876.8414.16277366835627437779.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20200420024421.22442-3-changhuaixin@linux.alibaba.com>
The following commit has been merged into the sched/core branch of tip:
Commit-ID: 5a6d6a6ccb5f48ca8cf7c6d64ff83fd9c7999390
Gitweb: https://git.kernel.org/tip/5a6d6a6ccb5f48ca8cf7c6d64ff83fd9c7999390
Author: Huaixin Chang <changhuaixin@linux.alibaba.com>
AuthorDate: Mon, 20 Apr 2020 10:44:21 +08:00
Committer: Peter Zijlstra <peterz@infradead.org>
CommitterDate: Thu, 30 Apr 2020 20:14:40 +02:00
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 | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index c0216ef..fac5b2f 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -5159,6 +5159,8 @@ static enum hrtimer_restart sched_cfs_period_timer(struct hrtimer *timer)
if (!overrun)
break;
+ idle = do_sched_cfs_period_timer(cfs_b, overrun, flags);
+
if (++count > 3) {
u64 new, old = ktime_to_ns(cfs_b->period);
@@ -5188,8 +5190,6 @@ static enum hrtimer_restart sched_cfs_period_timer(struct hrtimer *timer)
/* reset count so we don't come right back in here */
count = 0;
}
-
- idle = do_sched_cfs_period_timer(cfs_b, overrun, flags);
}
if (idle)
cfs_b->period_active = 0;
prev parent reply other threads:[~2020-05-01 18:23 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-20 2:44 [PATCH 0/2] Two small fixes for bandwidth controller Huaixin Chang
2020-04-20 2:44 ` [PATCH 1/2] sched: Defend cfs and rt bandwidth quota against overflow Huaixin Chang
2020-04-20 17:50 ` bsegall
2020-04-22 3:36 ` changhuaixin
2020-04-22 18:44 ` bsegall
2020-04-23 13:37 ` [PATCH] " Huaixin Chang
2020-04-23 20:33 ` bsegall
2020-04-25 10:52 ` [PATCH v2] " Huaixin Chang
2020-04-27 18:29 ` bsegall
2020-05-11 13:03 ` Peter Zijlstra
2020-05-19 18:44 ` [tip: sched/core] " tip-bot2 for Huaixin Chang
2020-04-22 8:38 ` [PATCH 1/2] " kbuild test robot
2020-04-24 6:35 ` kbuild test robot
2020-04-20 2:44 ` [PATCH 2/2] sched/fair: Refill bandwidth before scaling Huaixin Chang
2020-04-20 17:54 ` bsegall
2020-04-21 15:09 ` Phil Auld
2020-05-01 18:22 ` tip-bot2 for Huaixin Chang [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=158835732876.8414.16277366835627437779.tip-bot2@tip-bot2 \
--to=tip-bot2@linutronix.de \
--cc=bsegall@google.com \
--cc=changhuaixin@linux.alibaba.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=pauld@redhat.com \
--cc=peterz@infradead.org \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®