[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YKzVu2cOYRN9TZD3@hirez.programming.kicks-ass.net>
Date: Tue, 25 May 2021 12:47:23 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: changhuaixin <changhuaixin@...ux.alibaba.com>
Cc: Benjamin Segall <bsegall@...gle.com>,
Dietmar Eggemann <dietmar.eggemann@....com>,
dtcccc@...ux.alibaba.com, Juri Lelli <juri.lelli@...hat.com>,
khlebnikov@...dex-team.ru,
open list <linux-kernel@...r.kernel.org>,
Mel Gorman <mgorman@...e.de>, Ingo Molnar <mingo@...hat.com>,
Odin Ugedal <odin@...d.al>, Odin Ugedal <odin@...dal.com>,
pauld@...head.com, Paul Turner <pjt@...gle.com>,
Steven Rostedt <rostedt@...dmis.org>,
Shanpei Chen <shanpeic@...ux.alibaba.com>,
Tejun Heo <tj@...nel.org>,
Vincent Guittot <vincent.guittot@...aro.org>,
xiyou.wangcong@...il.com
Subject: Re: [PATCH v5 1/3] sched/fair: Introduce the burstable CFS controller
On Mon, May 24, 2021 at 08:42:03PM +0800, changhuaixin wrote:
> >> static inline struct cfs_bandwidth *tg_cfs_bandwidth(struct task_group *tg)
> >> @@ -4651,6 +4666,9 @@ static int __assign_cfs_rq_runtime(struct cfs_bandwidth *cfs_b,
> >> if (cfs_b->quota == RUNTIME_INF)
> >> amount = min_amount;
> >> else {
> >> + if (!cfs_b->period_active)
> >> + __refill_cfs_bandwidth_runtime(cfs_b);
> >
> > Why this call?
>
> As the cfs bandwidth timer stops on idle with runtime unfilled, refill runtime when it restarts to make
> use of the underrun when period timer stops. Another way to do this might be:
>
> throttled = !list_empty(&cfs_b->throttled_cfs_rq);
> cfs_b->nr_periods += overrun;
>
> + __refill_cfs_bandwidth_runtime(cfs_b);
> +
> /*
> * idle depends on !throttled (for the case of a large deficit), and if
> * we're going inactive then everything else can be deferred
> */
> if (cfs_b->idle && !throttled)
> goto out_deactivate;
>
> - __refill_cfs_bandwidth_runtime(cfs_b);
> -
> if (!throttled) {
>
Ben, do you have a preference?
Powered by blists - more mailing lists