lkml.org 
[lkml]   [2021]   [May]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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?

\
 
 \ /
  Last update: 2021-05-25 12:49    [W:0.082 / U:0.092 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site