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]
Date:	Wed, 20 Oct 2010 17:03:43 +0200
From:	Peter Zijlstra <peterz@...radead.org>
To:	Bruno Randolf <br1@...fach.org>
Cc:	randy.dunlap@...cle.com, akpm@...ux-foundation.org,
	kevin.granade@...il.com, Lars_Ericsson@...ia.com,
	blp@...stanford.edu, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3] Add generic exponentially weighted moving average
 (EWMA) function

On Wed, 2010-10-20 at 17:23 +0900, Bruno Randolf wrote:
> +/**
> + * ewma_add() - Exponentially weighted moving average (EWMA)
> + * @avg: Average structure
> + * @val: Current value
> + *
> + * Add a sample to the average.
> + */
> +struct ewma*
> +ewma_add(struct ewma *avg, const unsigned int val)
> +{
> +       avg->internal = avg->internal  ?
> +               (((avg->internal * (avg->weight - 1)) +
> +                       (val * avg->factor)) / avg->weight) :
> +               (val * avg->factor);
> +       return avg;
> +}
> +EXPORT_SYMBOL(ewma_add); 

How can it be a weighted avg if each sample has the same weight?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ