From: Valentin Schneider <valentin.schneider@arm.com>
To: Liangyan <liangyan.peng@linux.alibaba.com>,
Ingo Molnar <mingo@redhat.com>,
Peter Zijlstra <peterz@infradead.org>,
Ben Segall <bsegall@google.com>,
linux-kernel@vger.kernel.org
Cc: shanpeic@linux.alibaba.com, xlpang@linux.alibaba.com
Subject: Re: [PATCH v3] sched/fair: don't assign runtime for throttled cfs_rq
Date: Wed, 28 Aug 2019 11:16:52 +0100 [thread overview]
Message-ID: <71df56cc-529b-aefb-2905-48e02de5cf86@arm.com> (raw)
In-Reply-To: <20190826121633.6538-1-liangyan.peng@linux.alibaba.com>
On 26/08/2019 13:16, Liangyan wrote:
> do_sched_cfs_period_timer() will refill cfs_b runtime and call
> distribute_cfs_runtime to unthrottle cfs_rq, sometimes cfs_b->runtime
> will allocate all quota to one cfs_rq incorrectly, then other cfs_rqs
> attached to this cfs_b can't get runtime and will be throttled.
>
> We find that one throttled cfs_rq has non-negative
> cfs_rq->runtime_remaining and cause an unexpetced cast from s64 to u64
> in snippet: distribute_cfs_runtime() {
> runtime = -cfs_rq->runtime_remaining + 1; }.
> The runtime here will change to a large number and consume all
> cfs_b->runtime in this cfs_b period.
>
> According to Ben Segall, the throttled cfs_rq can have
> account_cfs_rq_runtime called on it because it is throttled before
> idle_balance, and the idle_balance calls update_rq_clock to add time
> that is accounted to the task.
>
> This commit prevents cfs_rq to be assgined new runtime if it has been
> throttled until that distribute_cfs_runtime is called.
>
> Signed-off-by: Liangyan <liangyan.peng@linux.alibaba.com>
> Reviewed-by: Ben Segall <bsegall@google.com>
> Reviewed-by: Valentin Schneider <valentin.schneider@arm.com>
@Peter/Ingo, if we care about it I believe it can't hurt to strap
Cc: <stable@vger.kernel.org>
Fixes: d3d9dc330236 ("sched: Throttle entities exceeding their allowed bandwidth")
to the thing.
next prev parent reply other threads:[~2019-08-28 10:16 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-26 12:16 [PATCH v3] sched/fair: don't assign runtime for throttled cfs_rq Liangyan
2019-08-28 10:16 ` Valentin Schneider [this message]
2019-08-28 11:41 ` Peter Zijlstra
2019-09-03 8:31 ` [tip: sched/urgent] sched/fair: Don't " tip-bot2 for 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=71df56cc-529b-aefb-2905-48e02de5cf86@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@redhat.com \
--cc=peterz@infradead.org \
--cc=shanpeic@linux.alibaba.com \
--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