From: Simon Horman <horms@verge.net.au>
To: Julian Anastasov <ja@ssi.bg>, Hans Schillstrom <hans@schillstrom.com>
Cc: lvs-devel@vger.kernel.org
Subject: Re: [PATCH net 4/4] ipvs: stats should not depend on CPU 0
Date: Fri, 30 Aug 2013 17:53:32 +0900 [thread overview]
Message-ID: <20130830085332.GA10484@verge.net.au> (raw)
In-Reply-To: <1377848768.12846.122.camel@hawk.mlab.se> <alpine.LFD.2.00.1308301029350.1837@ja.ssi.bg>
On Fri, Aug 30, 2013 at 10:31:57AM +0300, Julian Anastasov wrote:
>
> Hello,
>
> On Fri, 30 Aug 2013, Simon Horman wrote:
>
> > [ Cc: Hans Schillstrom ]
> >
> > On Wed, Aug 28, 2013 at 07:29:36PM +0300, Julian Anastasov wrote:
> > > When reading percpu stats we need to properly reset
> > > the sum when CPU 0 is not present in the possible mask.
> >
> > It seems reasonable to me that this condition could occur,
> > though I am not aware of a specific case where that is so.
> >
> > Can I confirm that this problem was introduced by
> > b17fc9963f837ef1 ("IPVS: netns, ip_vs_stats and its procfs")?
>
> That is correct, I forgot to track the initial
> commit, you can freely add such information before
> applying.
>
> Regards
>
> --
> Julian Anastasov <ja@ssi.bg>
>
On Fri, Aug 30, 2013 at 09:46:08AM +0200, Hans Schillstrom wrote:
>
> On Wed, 2013-08-28 at 19:29 +0300, Julian Anastasov wrote:
> > When reading percpu stats we need to properly reset
> > the sum when CPU 0 is not present in the possible mask.
>
> Not a very common case, but still possible.
>
> > Signed-off-by: Julian Anastasov <ja@ssi.bg>
>
> Acked-by: Hans Schillstrom <hans@schillstrom.com>
Thanks guys, I have queued up the following in the ipvs tree
along with the rest of this series.
From 056a057b581b7a98669e65745c9866d233f82a18 Mon Sep 17 00:00:00 2001
From: Julian Anastasov <ja@ssi.bg>
Date: Wed, 28 Aug 2013 19:29:36 +0300
Subject: [PATCH] ipvs: stats should not depend on CPU 0
When reading percpu stats we need to properly reset
the sum when CPU 0 is not present in the possible mask.
This problem was introduced by 17fc9963f837ef1
("IPVS: netns, ip_vs_stats and its procfs").
Signed-off-by: Julian Anastasov <ja@ssi.bg>
Acked-by: Hans Schillstrom <hans@schillstrom.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
---
net/netfilter/ipvs/ip_vs_est.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/net/netfilter/ipvs/ip_vs_est.c b/net/netfilter/ipvs/ip_vs_est.c
index 6bee6d0..1425e9a 100644
--- a/net/netfilter/ipvs/ip_vs_est.c
+++ b/net/netfilter/ipvs/ip_vs_est.c
@@ -59,12 +59,13 @@ static void ip_vs_read_cpu_stats(struct ip_vs_stats_user *sum,
struct ip_vs_cpu_stats __percpu *stats)
{
int i;
+ bool add = false;
for_each_possible_cpu(i) {
struct ip_vs_cpu_stats *s = per_cpu_ptr(stats, i);
unsigned int start;
__u64 inbytes, outbytes;
- if (i) {
+ if (add) {
sum->conns += s->ustats.conns;
sum->inpkts += s->ustats.inpkts;
sum->outpkts += s->ustats.outpkts;
@@ -76,6 +77,7 @@ static void ip_vs_read_cpu_stats(struct ip_vs_stats_user *sum,
sum->inbytes += inbytes;
sum->outbytes += outbytes;
} else {
+ add = true;
sum->conns = s->ustats.conns;
sum->inpkts = s->ustats.inpkts;
sum->outpkts = s->ustats.outpkts;
--
1.8.3.2
next prev parent reply other threads:[~2013-08-30 8:53 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-28 16:29 [PATCH net 0/4] IPVS fixes for corner cases Julian Anastasov
2013-08-28 16:29 ` [PATCH net 1/4] ipvs: do not use dest after ip_vs_dest_put in LBLC Julian Anastasov
2013-08-28 16:29 ` [PATCH net 2/4] ipvs: do not use dest after ip_vs_dest_put in LBLCR Julian Anastasov
2013-08-28 16:29 ` [PATCH net 3/4] ipvs: make the service replacement more robust Julian Anastasov
2013-09-10 19:28 ` Julian Anastasov
2013-09-11 3:58 ` Simon Horman
2013-08-28 16:29 ` [PATCH net 4/4] ipvs: stats should not depend on CPU 0 Julian Anastasov
2013-08-30 1:17 ` Simon Horman
2013-08-30 7:31 ` Julian Anastasov
2013-08-30 8:53 ` Simon Horman [this message]
2013-08-30 8:58 ` Simon Horman
2013-08-30 9:53 ` Julian Anastasov
2013-08-30 7:46 ` Hans Schillstrom
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130830085332.GA10484@verge.net.au \
--to=horms@verge.net.au \
--cc=hans@schillstrom.com \
--cc=ja@ssi.bg \
--cc=lvs-devel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.