From: Valentin Schneider <valentin.schneider@arm.com>
To: bsegall@google.com
Cc: linux-kernel@vger.kernel.org, mingo@kernel.org,
peterz@infradead.org, liangyan.peng@linux.alibaba.com,
shanpeic@linux.alibaba.com, xlpang@linux.alibaba.com,
pjt@google.com, stable@vger.kernel.org
Subject: Re: [PATCH] sched/fair: Add missing unthrottle_cfs_rq()
Date: Thu, 22 Aug 2019 22:10:42 +0100 [thread overview]
Message-ID: <0df3e0e2-b5cc-d689-7776-c7a31ad244dc@arm.com> (raw)
In-Reply-To: <20382abf-4741-7792-d830-34603409361e@arm.com>
On 22/08/2019 21:40, Valentin Schneider wrote:
> On 22/08/2019 19:48, bsegall@google.com wrote:
Re we shouldn't get account_cfs_rq_runtime() called on throttled cfs_rq's,
with this:
---
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 171eef3f08f9..1acb88024cad 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -4385,6 +4385,11 @@ static inline u64 cfs_rq_clock_task(struct cfs_rq *cfs_rq)
return rq_clock_task(rq_of(cfs_rq)) - cfs_rq->throttled_clock_task_time;
}
+static inline int cfs_rq_throttled(struct cfs_rq *cfs_rq)
+{
+ return cfs_bandwidth_used() && cfs_rq->throttled;
+}
+
/* returns 0 on failure to allocate runtime */
static int assign_cfs_rq_runtime(struct cfs_rq *cfs_rq)
{
@@ -4411,6 +4416,8 @@ static int assign_cfs_rq_runtime(struct cfs_rq *cfs_rq)
cfs_rq->runtime_remaining += amount;
+ WARN_ON(cfs_rq_throttled(cfs_rq) && cfs_rq->runtime_remaining > 0);
+
return cfs_rq->runtime_remaining > 0;
}
@@ -4436,12 +4443,9 @@ void account_cfs_rq_runtime(struct cfs_rq *cfs_rq, u64 delta_exec)
if (!cfs_bandwidth_used() || !cfs_rq->runtime_enabled)
return;
- __account_cfs_rq_runtime(cfs_rq, delta_exec);
-}
+ WARN_ON(cfs_rq_throttled(cfs_rq));
-static inline int cfs_rq_throttled(struct cfs_rq *cfs_rq)
-{
- return cfs_bandwidth_used() && cfs_rq->throttled;
+ __account_cfs_rq_runtime(cfs_rq, delta_exec);
}
/* check whether cfs_rq, or any parent, is throttled */
---
I get this:
[ 204.798643] Call Trace:
[ 204.798645] put_prev_entity+0x8d/0x100
[ 204.798647] put_prev_task_fair+0x22/0x40
[ 204.798648] pick_next_task_idle+0x36/0x50
[ 204.798650] __schedule+0x61d/0x6c0
[ 204.798651] schedule+0x2d/0x90
[ 204.798653] exit_to_usermode_loop+0x61/0x100
[ 204.798654] prepare_exit_to_usermode+0x91/0xa0
[ 204.798656] retint_user+0x8/0x8
(this is a hit on the account_cfs_rq_runtime() WARN_ON)
next prev parent reply other threads:[~2019-08-22 21:10 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-14 18:00 [PATCH] sched/fair: don't assign runtime for throttled cfs_rq Liangyan
2019-08-15 16:36 ` Valentin Schneider
[not found] ` <7C1833A8-27A4-4755-9B1E-335C20207A66@linux.alibaba.com>
2019-08-16 14:02 ` Valentin Schneider
2019-08-16 14:31 ` Valentin Schneider
[not found] ` <02BC41EE-6653-4473-91D4-CDEE53D8703D@linux.alibaba.com>
2019-08-16 17:19 ` Valentin Schneider
2019-08-19 17:34 ` Valentin Schneider
2019-08-20 10:54 ` [PATCH] sched/fair: Add missing unthrottle_cfs_rq() Valentin Schneider
2019-08-22 9:21 ` Peter Zijlstra
2019-08-22 17:43 ` bsegall
2019-08-22 18:48 ` bsegall
2019-08-22 20:40 ` Valentin Schneider
2019-08-22 21:10 ` Valentin Schneider [this message]
2019-08-23 7:22 ` Liangyan
2019-08-23 20:00 ` [PATCH] sched/fair: don't assign runtime for throttled cfs_rq bsegall
2019-08-23 23:19 ` Valentin Schneider
2019-08-26 17:38 ` bsegall
2019-08-27 2:45 ` Liangyan
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=0df3e0e2-b5cc-d689-7776-c7a31ad244dc@arm.com \
--to=valentin.schneider@arm.com \
--cc=bsegall@google.com \
--cc=liangyan.peng@linux.alibaba.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=pjt@google.com \
--cc=shanpeic@linux.alibaba.com \
--cc=stable@vger.kernel.org \
--cc=xlpang@linux.alibaba.com \
/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®