diff options
author | Julian Anastasov <ja@ssi.bg> | 2011-03-13 19:37:49 -0400 |
---|---|---|
committer | Simon Horman <horms@verge.net.au> | 2011-03-14 20:36:52 -0400 |
commit | 55a3d4e15c7c953ecc55b96b83d2679abf8a7899 (patch) | |
tree | d1f1c52c77c04b717ca1a26bc7a0e90adb0498df /include/net | |
parent | 2a0751af09c3099cf2837c623ca5d0436317d02d (diff) |
ipvs: properly zero stats and rates
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>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/ip_vs.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h index 9db750d9082d..06f5af4b626d 100644 --- a/include/net/ip_vs.h +++ b/include/net/ip_vs.h | |||
@@ -374,6 +374,7 @@ struct ip_vs_stats { | |||
374 | struct ip_vs_estimator est; /* estimator */ | 374 | struct ip_vs_estimator est; /* estimator */ |
375 | struct ip_vs_cpu_stats *cpustats; /* per cpu counters */ | 375 | struct ip_vs_cpu_stats *cpustats; /* per cpu counters */ |
376 | spinlock_t lock; /* spin lock */ | 376 | spinlock_t lock; /* spin lock */ |
377 | struct ip_vs_stats_user ustats0; /* reset values */ | ||
377 | }; | 378 | }; |
378 | 379 | ||
379 | /* | 380 | /* |