diff options
author | Julian Anastasov <ja@ssi.bg> | 2011-03-04 12:20:35 +0200 |
---|---|---|
committer | Simon Horman <horms@verge.net.au> | 2011-03-15 09:36:52 +0900 |
commit | 2a0751af09c3099cf2837c623ca5d0436317d02d (patch) | |
tree | c88e052386d8a94c5e239c6abdd1f4b9c86afbef /net/netfilter/ipvs/ip_vs_est.c | |
parent | ipvs: move struct netns_ipvs (diff) | |
download | linux-dev-2a0751af09c3099cf2837c623ca5d0436317d02d.tar.xz linux-dev-2a0751af09c3099cf2837c623ca5d0436317d02d.zip |
ipvs: reorganize tot_stats
The global tot_stats contains cpustats field just like the
stats for dest and svc, so better use it to simplify the usage
in estimation_timer. As tot_stats is registered as estimator
we can remove the special ip_vs_read_cpu_stats call for
tot_stats. Fix ip_vs_read_cpu_stats to be called under
stats lock because it is still used as synchronization between
estimation timer and user context (the stats readers).
Also, make sure ip_vs_stats_percpu_show reads properly
the u64 stats from user context.
Signed-off-by: Julian Anastasov <ja@ssi.bg>
Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
Diffstat (limited to 'net/netfilter/ipvs/ip_vs_est.c')
-rw-r--r-- | net/netfilter/ipvs/ip_vs_est.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/net/netfilter/ipvs/ip_vs_est.c b/net/netfilter/ipvs/ip_vs_est.c index 88bd71647bf5..b3751cfede2c 100644 --- a/net/netfilter/ipvs/ip_vs_est.c +++ b/net/netfilter/ipvs/ip_vs_est.c @@ -101,13 +101,12 @@ static void estimation_timer(unsigned long arg) struct netns_ipvs *ipvs; ipvs = net_ipvs(net); - ip_vs_read_cpu_stats(&ipvs->tot_stats->ustats, ipvs->cpustats); spin_lock(&ipvs->est_lock); list_for_each_entry(e, &ipvs->est_list, list) { s = container_of(e, struct ip_vs_stats, est); - ip_vs_read_cpu_stats(&s->ustats, s->cpustats); spin_lock(&s->lock); + ip_vs_read_cpu_stats(&s->ustats, s->cpustats); n_conns = s->ustats.conns; n_inpkts = s->ustats.inpkts; n_outpkts = s->ustats.outpkts; |