Re: [PATCH 03/20] ipvs: properly zero stats and rates

Eric Dumazet
2011-03-14T04:09:09Z

Le lundi 14 mars 2011 à 12:45 +0900, Simon Horman a écrit :
> From: Julian Anastasov <ja@ssi.bg>
>
> Currently, the new percpu counters are not zeroed and
> the zero commands do not work as expected, we still show the old
> sum of percpu values. OTOH, we can not reset the percpu counters
> from user context without causing the incrementing to use old
> and bogus values.
>
> So, as Eric Dumazet suggested fix that by moving all overhead
> to stats reading in user context. Do not introduce overhead in
> timer context (estimator) and incrementing (packet handling in
> softirqs).
>
> The new ustats0 field holds the zero point for all
> counter values, the rates always use 0 as base value as before.
> When showing the values to user space just give the difference
> between counters and the base values. The only drawback is that
> percpu stats are not zeroed, they are accessible only from /proc
> and are new interface, so it should not be a compatibility problem
> as long as the sum stats are correct after zeroing.
>
> Signed-off-by: Julian Anastasov <ja@ssi.bg>
> Signed-off-by: Simon Horman <horms@verge.net.au>

Acked-by: Eric Dumazet <eric.dumazet@gmail.com>