diff options
author | Julian Anastasov <ja@ssi.bg> | 2011-03-14 01:37:49 +0200 |
---|---|---|
committer | Simon Horman <horms@verge.net.au> | 2011-03-15 09:36:52 +0900 |
commit | 55a3d4e15c7c953ecc55b96b83d2679abf8a7899 (patch) | |
tree | d1f1c52c77c04b717ca1a26bc7a0e90adb0498df /include/net/ip_vs.h | |
parent | 2a0751af09c3099cf2837c623ca5d0436317d02d (diff) | |
download | linux-55a3d4e15c7c953ecc55b96b83d2679abf8a7899.tar.bz2 |
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/ip_vs.h')
-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 { struct ip_vs_estimator est; /* estimator */ struct ip_vs_cpu_stats *cpustats; /* per cpu counters */ spinlock_t lock; /* spin lock */ + struct ip_vs_stats_user ustats0; /* reset values */ }; /* |