Re: [PATCH net-next v4 5/6] lib: Ensure EWMA does not store wrong intermediate values
From: Eric Dumazet <hidden>
Date: 2014-01-16 20:08:47
Also in:
virtualization
From: Eric Dumazet <hidden>
Date: 2014-01-16 20:08:47
Also in:
virtualization
On Thu, 2014-01-16 at 11:52 -0800, Michael Dalton wrote:
To ensure ewma_read() without a lock returns a valid but possibly out of date average, modify ewma_add() by using ACCESS_ONCE to prevent intermediate wrong values from being written to avg->internal. Suggested-by: Eric Dumazet <redacted> Signed-off-by: Michael Dalton <redacted> --- lib/average.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
Signed-off-by: Eric Dumazet <redacted>