lkml.org 
[lkml]   [2020]   [Feb]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 4/5] sched/pelt: Add a new runnable average signal
On Tue, Feb 18, 2020 at 02:54:40PM +0000, Valentin Schneider wrote:
> Humph, that's an exact copy of update_tg_cfs_util(). FWIW the following
> eldritch horror compiles...
>

> +#define DECLARE_UPDATE_TG_CFS_SIGNAL(signal) \
> +static inline void \
> +update_tg_cfs_##signal(struct cfs_rq *cfs_rq, struct sched_entity *se, struct cfs_rq *gcfs_rq) \
> +{ \
> + long delta = gcfs_rq->avg.signal##_avg - se->avg.signal##_avg; \
> + \
> + /* Nothing to update */ \
> + if (!delta) \
> + return; \
> + \
> + /* \
> + * The relation between sum and avg is: \
> + * \
> + * LOAD_AVG_MAX - 1024 + sa->period_contrib \
> + * \
> + * however, the PELT windows are not aligned between grq and gse. \
> + */ \
> + /* Set new sched_entity's runnable */ \
> + se->avg.signal##_avg = gcfs_rq->avg.signal##_avg; \
> + se->avg.signal##_sum = se->avg.signal##_avg * LOAD_AVG_MAX; \
> + \
> + /* Update parent cfs_rq signal## */ \
> + add_positive(&cfs_rq->avg.signal##_avg, delta); \
> + cfs_rq->avg.signal##_sum = cfs_rq->avg.signal##_avg * LOAD_AVG_MAX; \
> +} \
>
> - /* Update parent cfs_rq runnable */
> - add_positive(&cfs_rq->avg.runnable_avg, delta);
> - cfs_rq->avg.runnable_sum = cfs_rq->avg.runnable_avg * LOAD_AVG_MAX;
> -}
> +DECLARE_UPDATE_TG_CFS_SIGNAL(util);
> +DECLARE_UPDATE_TG_CFS_SIGNAL(runnable);

I'm not sure that's actually better though... :-)

\
 
 \ /
  Last update: 2020-02-18 16:13    [W:0.117 / U:1.000 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site