[Click] integer average

Eddie Kohler kohler at cs.ucla.edu
Fri Feb 29 15:30:27 EST 2008


Hi Roman,

Sorry for not responding to this earlier.  Click's EWMA classes are usable in 
the kernel and provide a weighted moving average.  For a precise average, a 
64-bit accumulator + count could probably work, especially if you scale down 
the delay (do you really need all those significant figures?).

Eddie


Roman Chertov wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Hello,
> 	I have an element that needs to keep a track of an average packet delay
> and I would like to keep it in the kernel due to speed reasons.
> Obviously I cannot use floats (to use the usual running average
> equation) and the numbers wrap around pretty fas, hence the standard
> method of an accumulator does not work.  Does anybody know how to get
> this issue solved?
> 
> 
> Many Thanks,
> 
> Roman
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.6 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
> 
> iD8DBQFHYa7iT8ksiSCF2AYRAh1BAKC9pEhGFnyegXNFWNZ3kalZwFACvwCgyvoZ
> MXz9++9nPR8Q6z2eljTBJO4=
> =yX8J
> -----END PGP SIGNATURE-----
> _______________________________________________
> click mailing list
> click at amsterdam.lcs.mit.edu
> https://amsterdam.lcs.mit.edu/mailman/listinfo/click


More information about the click mailing list