lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200218151211.GE14914@hirez.programming.kicks-ass.net>
Date:   Tue, 18 Feb 2020 16:12:11 +0100
From:   Peter Zijlstra <peterz@...radead.org>
To:     Valentin Schneider <valentin.schneider@....com>
Cc:     Vincent Guittot <vincent.guittot@...aro.org>, mingo@...hat.com,
        juri.lelli@...hat.com, dietmar.eggemann@....com,
        rostedt@...dmis.org, bsegall@...gle.com, mgorman@...e.de,
        linux-kernel@...r.kernel.org, pauld@...hat.com,
        parth@...ux.ibm.com, hdanton@...a.com
Subject: Re: [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... :-)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ