[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20190826092506.GO2369@hirez.programming.kicks-ass.net>
Date: Mon, 26 Aug 2019 11:25:06 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Liangyan <liangyan.peng@...ux.alibaba.com>
Cc: Ingo Molnar <mingo@...hat.com>, Ben Segall <bsegall@...gle.com>,
Valentin Schneider <valentin.schneider@....com>,
linux-kernel@...r.kernel.org, shanpeic@...ux.alibaba.com,
xlpang@...ux.alibaba.com
Subject: Re: [PATCH v2] sched/fair: don't assign runtime for throttled cfs_rq
On Sat, Aug 24, 2019 at 05:15:58PM +0800, 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.
> This will cause other cfs_rq 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; }.
> This cast will cause that runtime will be a large number and
> cfs_b->runtime will be subtracted to be zero at last.
> 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.
That is distinctly unreadable. Please try again with a little bit of
whitespace added.
> This commit prevents cfs_rq to be assgined new runtime if it has been
> throttled to avoid the above incorrect type cast.
>
> Signed-off-by: Liangyan <liangyan.peng@...ux.alibaba.com>
> Reviewed-by: Ben Segall <bsegall@...gle.com>
> Reviewed-by: Valentin Schneider <valentin.schneider@....com>
Powered by blists - more mailing lists